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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
34df092e3a8eebf03d8c6ee83e019b8231bb14d4 | PHP | majaco/EventSauce | /src/Message.php | UTF-8 | 1,644 | 2.890625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace EventSauce\EventSourcing;
use RuntimeException;
final class Message
{
/**
* @var object
*/
private $event;
/**
* @var array
*/
private $headers;
public function __construct(object $event, array $headers = [])
{
$this->eve... | true |
44369e25c401248b732e2b3c67ae931ffc044740 | PHP | nishimura/laiz-monad | /test/src/Laiz/Test/Func/TypeStringTest.php | UTF-8 | 515 | 2.859375 | 3 | [
"MIT"
] | permissive | <?php
namespace Laiz\Test\Func;
use function Laiz\Func\Monad\bind;
use function Laiz\Func\Monoid\mappend;
class TypeStringTest extends \PHPUnit_Framework_TestCase
{
public function testBind()
{
$m = 'abc';
$f = function($a){ return $a . ','; };
$m1 = bind($m, $f);
$this->assert... | true |
5410eb4a0318349ce41c0f3eaeab32453ad26cf0 | PHP | seboettg/citeproc-php | /tests/src/ContextTest.php | UTF-8 | 2,288 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
/*
* citeproc-php
*
* @link http://github.com/seboettg/citeproc-php for the source repository
* @copyright Copyright (c) 2017 Sebastian Böttger.
* @license https://opensource.org/licenses/MIT
*/
namespace Seboettg\CiteProc\Test;
use PHPUnit\Framework\TestCase;
use Seboettg\CiteProc\CiteProc;
... | true |
23f9d8c542021378b4a5f6c24589d35ecea1831b | PHP | briandidierjean/projet5-da-php-symfony-oc | /src/controllers/CommentController.php | UTF-8 | 3,540 | 2.609375 | 3 | [] | no_license | <?php
namespace App\Controller;
use \Core\Controller;
use \Core\HTTPRequest;
use \Core\HTTPResponse;
use \App\Model\Entity\Comment;
use \App\FormBuilder\CommentFormBuilder;
use \App\FormHandler\CommentFormHandler;
class CommentController extends Controller
{
/**
* Add a comment
*
* @return void
... | true |
c45dbb4fec08ccbba7a6e94ee9e1967cae489e2f | PHP | JardrielSousa/ProjetosPhpAntigos | /mvc - hello/controller.php | UTF-8 | 195 | 2.546875 | 3 | [] | no_license | <?php
include 'model.php';
include 'view.php';
class Controller{
public function action(){
$messege = (new Model())->getMessage();
return (new View($messege))->render();
}
}
?> | true |
d6d19281431dc7f5dd238476ae82b23af75a2731 | PHP | alexzagu/SIASS-ALEAE | /database/seeds/DatabaseSeeder.php | UTF-8 | 4,771 | 2.515625 | 3 | [] | no_license | <?php
use Illuminate\Database\Seeder;
use App\User;
use App\Period;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
//User seeder---------------------------------------------
for ($i = 1; $i <= 12; $i++) {
... | true |
7b5c3510284a9bae27348162ac6dd725b89e08d5 | PHP | mmuriel/sleefs-shiphero-gsheetsv4 | /app/app/Sleefs/Helpers/Google/SpreadSheets/GoogleSpreadsheetFileUnLocker.php | UTF-8 | 572 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace Sleefs\Helpers\Google\SpreadSheets;
class GoogleSpreadsheetFileUnLocker{
public function unLockFile($gSpreadSheet,$ctrlWsIndex){
try{
$worksheets = $gSpreadSheet->getWorksheetFeed()->getEntries();
$worksheet = $worksheets[$ctrlWsIndex];
$cellFeed = $worksheet-... | true |
6c6a10877f1f0c833741a8c17a928a43d6f996c0 | PHP | danielvasic/FPMOZ-PZI-2019-2020 | /VJ03/model/korisnik.class.php | UTF-8 | 1,409 | 3.015625 | 3 | [] | no_license | <?php
class Korisnik extends Model {
protected $id;
protected $korisnickoime;
protected $lozinka;
protected $ime;
protected $prezime;
protected $email;
public function __construct ($korisnickoime="", $lozinka="", $id=0, $ime="", $prezime="", $email=""){
$this->id = $id;
$th... | true |
af5791a205527fed9c2d6422aac33bc3e3437f2c | PHP | Munerin22/calendar_todo | /app/Http/Controllers/TodoController.php | UTF-8 | 2,288 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;
use App\Todo;
class TodoController extends Controller
{
//ToDoの追加
public function add(Request $request) {
$validatedData = $request->validate([
'title' => 'required|max:50',
'main' => 'required',
'... | true |
e34109ec563409b86b49a65ea822af417162b229 | PHP | jesprna/classhub | /myclass/ajax/chat.php | UTF-8 | 1,209 | 2.609375 | 3 | [] | no_license | <?php
require '../core/init.php';
if(isset($_POST['method']) === true && empty($_POST['method']) === false){
$chat = new Chat();
$method = trim($_POST['method']);
if ($method === 'fetch'){
$messages = $chat->fetchMessages($_SESSION['current_class']);
if (empty($mess... | true |
165af565308c0f81fbc404bf7ecf72407cb203e2 | PHP | gencer1/Wt-Social | /app/Services/Account/AccountService.php | UTF-8 | 439 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Services\Account;
use App\Helpers\RequestHelper;
use App\Models\Accounts;
class AccountService{
private $request;
public function __construct()
{
$this->request = new RequestHelper();
}
public function addAccountToMaas($data):bool{
try {
Accounts:... | true |
c1f74d8caf1bc4754a12e50b9a21d991d90ca8f9 | PHP | babelfishz/ocalendar | /database/migrations/2018_11_13_121335_create_photos_table.php | UTF-8 | 960 | 2.5625 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePhotosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('photos', functio... | true |
a6d375f612e78a6db7362c740f24ea9039710348 | PHP | trickeytrickey/sqlDatabasing | /update.php | UTF-8 | 3,450 | 2.5625 | 3 | [] | no_license | <?php
//use session object
session_start();
//check for empty session
if(empty($_SESSION["errorMessage"]))
$_SESSION["errorMessage"] ="";
//open DB connect
include("includes/openDBConn.php");
//This file is validating as HTML5
//You need to use and HTML 5 validator to check your code
echo("<?xml version=\"1.0\" e... | true |
f967d2940db117d5d6c940405c41b735de730ab8 | PHP | WahyuS002/phpdasar | /pertemuan5/array3.php | UTF-8 | 569 | 2.984375 | 3 | [] | no_license | <?php
$mahasiswa = [
["Wahyu", "G1A018093", "Bengkulu"],
["Wahyuok", "G1B018093", "Bgkulu"],
["Wahyu", "G1C018093", "Bkulu"]
];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equ... | true |
e799a806ca9da6267afa64b5325bff2245544913 | PHP | robotNIXX/moscow-streets | /app/Transformers/UsersTransformer.php | UTF-8 | 499 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Transformers;
use App\Models\User;
use League\Fractal\TransformerAbstract;
use Spatie\Permission\Models\Role;
class UsersTransformer extends TransformerAbstract
{
public function transform(User $user)
{
return [
'id' => $user->id,
'name' => $user->name,
... | true |
383fad10def5fe5ae936431f9b2ad5e2a6536b23 | PHP | zarkomircheski/codeship-test | /wp-content/themes/grandfather/parts/sitemap-single.php | UTF-8 | 1,090 | 2.609375 | 3 | [
"MIT"
] | permissive | <h1 class="page-template__title sitemap__title">Sitemap for <?php the_time("F, Y"); ?>
<span> Total of <?php echo count($posts); ?> posts</span></h1>
<?php
if (have_posts()) :
echo "<ul class='sitemap sitemap__listing'>";
while (have_posts()) :
the_post();
printf(
"<li class='sit... | true |
bb7a372a8a24f4541629058aca9b011e0ad09909 | PHP | ib222dp/1DV449_ib222dp | /Projekt/src/model/MainModel.php | UTF-8 | 3,235 | 2.953125 | 3 | [] | no_license | <?php
abstract class MainModel
{
public function __construct() {
}
public function destroySession() {
$_SESSION = array();
if (ini_get("session.use_cookies")) {
$params = session_get_cookie_params();
setcookie(session_name(), '', time() - 42000, $params["path"],
... | true |
63b631e7a9a8a90ecba7ebf8321965eeeae6f1dd | PHP | chaimachakroun/chaima | /entities/sign.php | UTF-8 | 530 | 2.71875 | 3 | [] | no_license | <?php
class sign
{
private $first;
private $last;
private $user;
private $email;
private $mdp;
function __constract($first,$last,$user,$email,$mdp)
{
$this->first=$first;
$this->last=$last;
$this->user=$user;
$this->email=$email;
$this->mdp=$mdp;
}
function getFirst()
{
return $first->firs... | true |
ddfb164f256f2eec370d9937f18bce0aa9da8663 | PHP | jsconestilo/V2B_php-poo | /14_object2sting.php | UTF-8 | 918 | 4.09375 | 4 | [] | no_license | <?php
/**
* En ocasiones los usuarios de la clase tienden a imprimir el objeto instanciado. De forma predeterminada un objeto no puede ser convertido a cadena. Sin embargo, con el método mágico __toString() podemos retornar información relevante para este tipo de casos.
*/
class Person {
private $name;
private $... | true |
785cb5035391767142a7b83e2a19e529fd3c4b5b | PHP | tarasovc47/spravka | /from_serv/brief/login.php | UTF-8 | 5,113 | 2.921875 | 3 | [] | permissive | <?php
/*
Универсальный скрипт авторизации.
Используется сессии для хранения данных.
Скрипт типа "всё-в-одном" - его необходимо
включать в каждый файл для использования.
Распространяется по лицензии BSD.
+Требования:
+-Mysql & PHP5
+-Созданое подключение к MySQL и запущеная сессия =)
(c)2008 Vasilii B. Shpilchin
*/
... | true |
22a72fa601621793ad00da76fbe4bdbd43d9c67d | PHP | so-php/service-registry | /src/SoPhp/ServiceRegistry/AbstractFactory/ServiceRegistry.php | UTF-8 | 2,578 | 2.578125 | 3 | [] | no_license | <?php
namespace SoPhp\ServiceRegistry\AbstractFactory;
use SoPhp\Rpc\Proxy\ProxyAbstract;
use SoPhp\Rpc\Proxy\ProxyBuilder;
use SoPhp\ServiceRegistry\CircuitBreaker\CircuitBreaker;
use SoPhp\ServiceRegistry\RegistryService;
use SoPhp\ServiceRegistry\ServiceRegistryAwareInterface;
use SoPhp\ServiceRegistry\ServiceRe... | true |
f2c145edc6c1081e128963ecb2c33e7b7244805f | PHP | rummykhan/shop-api | /app/Models/Category.php | UTF-8 | 551 | 2.609375 | 3 | [] | no_license | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
* Class Category
* @package App\Models
*
* @property int $id
* @property string $name
* @property string $image
* @property int $parent_id
* @property string $created_at
* @property... | true |
5fd1ff90bcee4f4e421df8b6b8590d9eb9a7b0a9 | PHP | Toms412/Toms412.github.io | /PHP/traitement_mail.php | UTF-8 | 801 | 2.59375 | 3 | [] | no_license | <?php
$errors = [];
if(!array_key_exists("name", $_POST) || $_POST["name"] == ''){
$errors["name"] = "Veuillez renseigner votre nom";
}
if(!array_key_exists("mail", $_POST) || $_POST["mail"] == '' || ! filter_var($_POST["mail"], FILTER_VALIDATE_EMAIL)){
$errors["mail"] = "Veuillez renseigner une adresse mai... | true |
2971e6b5f91a9b06b338718ff9a99a56a00342b7 | PHP | alexshapran/cllab | /public_html/protected/controllers/ImageController.php | UTF-8 | 1,915 | 2.6875 | 3 | [] | no_license | <?php
class ImageController extends Controller
{
/**
* @return array action filters
*/
public function filters()
{
return array(
'accessControl', // perform access control for CRUD operations
);
}
/**
* Specifies the access control rules.
* This method is used by the 'accessControl' filter.
* @... | true |
6416b9a633d49e3c23d15aec6829f0b042351a24 | PHP | MuhGenta19/kurikulum-backend | /sprint-4/topik-2/latihan-3.1/home.php | UTF-8 | 2,615 | 2.71875 | 3 | [] | no_license | <?php
include('library.php');
$lib = new Library();
$data_barang = $lib->show();
session_start();
if (!isset($_SESSION['username'])) {
header('Location: login.php');
}
if(isset($_GET['hapus_barang']))
{
$id = $_GET['hapus_barang'];
$status_hapus = $lib->delete($id);
if($status_hapus)
{
he... | true |
5ad56a8fab10162c2cf5971c08b4db498415c254 | PHP | SourceCode/project-starfish | /includes/ajax/controllers/yui/obj.datasource.php | UTF-8 | 5,646 | 2.59375 | 3 | [] | no_license | <?php
/**
* @package starfish
* @author Ryan Rentfro, http://www.rentfro.net
* @version obj.datasource.php, v0.0.1a
* @copyright Ryan Rentfro, http://www.rentfro.net
* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
* @category ajaxUI
*/
/**
* @access public
* @var object yu... | true |
5f8586ec19db1e1c85776fd22dbd11b9f537c6d6 | PHP | alexandertonkonog/analytics-back | /models/Route.php | UTF-8 | 188 | 2.65625 | 3 | [] | no_license | <?php
class Route {
public function __construct($data) {
$this->id = $data['route_id'];
$this->points = json_decode($data['coors']);
}
}
?> | true |
31667f14c33dcf4366285b2bbe27b8a9ce60ad53 | PHP | eternity-wing/HACKER_R_code_challenges | /Medium/Max Array Sum/index.php | UTF-8 | 394 | 3.609375 | 4 | [] | no_license | <?php
function maxSubsetSum(int $n, array $arr)
{
$prev_prev = (int)$arr[0];
$prev = max($prev_prev, (int)$arr[1]);
for ($i = 2; $i < $n; $i++) {
$current = max((int)$arr[$i], $prev_prev + (int)$arr[$i], $prev);
$prev_prev = $prev;
$prev = $current;
}
echo $prev;
}
$n = r... | true |
0314549401b20295546706c6fd2154bfed530957 | PHP | scientecs/jocker | /app/Helpers/Url.php | UTF-8 | 635 | 3.140625 | 3 | [] | no_license | <?php
namespace App\Helpers;
/**
* Class of Url
*/
class Url {
/**
* Make url
*
* @param string $controller
* @param string $action
* @param array $args
*
* @return string
*/
public static function makeUrl($controller = "index", $action = "index", $args = []) {
... | true |
61f7a68d214b631605b1901f8c4572cb6127db87 | PHP | AgateChain/AgateDrupal7.X-Ubercart3.X | /agate/agate_lib.php | UTF-8 | 1,863 | 2.890625 | 3 | [] | no_license | <?php
// Log the errors and callbacks for debugging
function agate_log($contents)
{
error_log($contents);
}
// Convert currency to equivalent iUSD
function convertCurToIUSD($url, $amount, $api_key, $currencySymbol) {
error_log("Entered into Convert CAmount");
error_log($url.'?api_key='.$api_key.'¤cy='... | true |
ccc6387ed58f660833d04955b0808226695d3846 | PHP | kdemanuele/clounce_mathematics | /php/examples/arithmetic_mean_sequence.php | UTF-8 | 1,086 | 3.328125 | 3 | [
"MIT"
] | permissive | <?php
require_once('../lib/sequence_solver.php');
$variables = array_fill(0, 4, -1);
ClounceMath\SequenceSolver::arithmeticMeanSequence(45, 100, $variables);
print("Running example from Brilliant 17 March 2019 Daily Challenge" . PHP_EOL);
print("n the sequence of integers below, each number (starting with ... | true |
c3d4e3801391cbe278517f50bc54f6a47dd8b355 | PHP | dweb971/DWEB971 | /martine.opti-web.fr/scripts/AdminRM.php | UTF-8 | 6,224 | 3.015625 | 3 | [] | no_license | <?php
/**
*
*/
class AdminRM
{
// proprietes
private $_email;
private $_password;
private $_profil;
private $_connectDB;
private $_object;
private $_message;
// methodes
public function __construct($dbconnect)
{
$this->set_connectDB($dbconnect->pdo);
da... | true |
f695f287336767ca3846f131417a293fa037e93c | PHP | YoanRamirez/repositorio_cursophp | /aprendiendo/09-condicionales.php | UTF-8 | 5,368 | 3.359375 | 3 | [] | no_license | <?php
//el if ejecuta instrucciones
//operador
//== igual
// 1.Arithmetic Operator
// + = Addition
// - = Subtraction
// * = Multiplication
// / = Division
// % = Modulo
// ** = Exponentiation
// 2.Assignment Operator
// = "equal to
// 3.Array Operator
// + = Union
// == = Equality
// === = Identity... | true |
6f7e06d1139870d01d96c9c013749147fa25445d | PHP | frustratedidiot125/nesstocks | /src/TargetChecker.php | UTF-8 | 3,986 | 2.640625 | 3 | [] | no_license | <?php
namespace NesStocks;
class TargetChecker {
function __construct($config, $http = null, $parser = null) {
$this->config = $config;
$this->accessKey = null;
if (isset($config['key'])) {
$this->accessKey = $config['key'];
}
$this->http = $http ?: new HttpClient();
$this->parser = $parser ?: new ... | true |
27b153b8cdce799ef7c3d45595cdcf2ee7fa185f | PHP | inetstudio/products-finder | /entities/products/src/Http/Controllers/Back/DataController.php | UTF-8 | 2,255 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace InetStudio\ProductsFinder\Products\Http\Controllers\Back;
use Illuminate\Support\Str;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use InetStudio\AdminPanel\Base\Http\Controllers\Controller;
use Illuminate\Contracts\Container\BindingResolutionException;
use InetStudio\ProductsFinder\... | true |
a8fd121a4857c59992a74d8330b832dd6a08db24 | PHP | famelasiapno/it313-module5-codebytes-master | /populate-database/server.php | UTF-8 | 715 | 2.859375 | 3 | [] | no_license | <?php
// Connect to database
$connection = mysqli_connect("localhost", "root", "", "codebytes");
// Grab the data
$mealID = $_POST['mealID'];
$mealName = $_POST['mealName'];
$thumbnailLink = $_POST['thumbnailLink'];
$category = $_POST['category'];
$area = $_POST['area'];
$instructions = $_POST['instructions'];
$ingred... | true |
4f3cc13e9b0b0feffb40b5480519cf8f3797e3b1 | PHP | FloryneTourret/Piscine_PHP | /d08/ex00/Class/Obstacle.class.php | UTF-8 | 595 | 3.328125 | 3 | [] | no_license | <?php
class Obstacle {
use Doc;
private $_xpos;
private $_ypos;
private $_height;
private $_width;
public function __construct($x, $y, $w, $h) {
$this->_xpos = $x;
$this->_ypos = $y;
$this->_width = $w;
$this->_height = $h;
}
public function... | true |
f8da89492ce3f5df04fcf6df6ee4b13701c050a3 | PHP | Agungdecoco/E-Canteen | /app/controllers/registercontroller.php | UTF-8 | 1,376 | 2.765625 | 3 | [] | no_license | <?php
require __DIR__ . "/../Core/Query.php";
class RegisterController extends Query{
protected $name;
protected $email;
protected $password;
protected $confirm_password;
public $message;
public function getData($name, $email, $password, $confirm_password){
$this-> name = $name;
$this-> email = $email;
... | true |
1d72d29e4339fa75f4eebea33c4a6e788bec9511 | PHP | StereoFlo/Example-Laravel | /engine/app/Http/Controllers/Manager/Api/NewsController.php | UTF-8 | 1,869 | 2.578125 | 3 | [] | no_license | <?php
namespace RecycleArt\Http\Controllers\Manager\Api;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use RecycleArt\Http\Controllers\Controller;
/**
* Class NewsController
* @package RecycleArt\Http\Controllers\Manager\Api
*/
class NewsController extends Controller
{
/**
* @param \Recy... | true |
0d94a9e9db4391583792806ef40a515e86fd1987 | PHP | chakuzo/Twibber | /lib/system/exception/SystemException.class.php | UTF-8 | 4,155 | 2.84375 | 3 | [] | no_license | <?php
/**
* A SystemException is thrown when an unexpected error occurs.
*
* @author Marcel Werk (modifications by kurtextrem).
* @copyright 2001-2009 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage sys... | true |
52ad2f0cf281482ed88b27e0938a5cf3fee5c09b | PHP | CesarJs/FormaGeek | /app/Transformers/MeasureTransformer.php | UTF-8 | 693 | 2.59375 | 3 | [] | no_license | <?php
namespace Treina\Models\Transformers;
use League\Fractal\TransformerAbstract;
use Treina\Models\Models\Measure;
/**
* Class MeasureTransformer.
*
* @package namespace Treina\Models\Transformers;
*/
class MeasureTransformer extends TransformerAbstract
{
/**
* Transform the Measure entity.
*
... | true |
c001214f844e626059f32c273cd391794f8a67f8 | PHP | Nishajain2000/group_quickpost | /index.php | UTF-8 | 1,777 | 2.578125 | 3 | [] | no_license | <?php
//incluse database connection value
include_once'connection.php';
//connect to database
$db=mysqli_connect($servername,$username,$password,$dbname);
//check connection
if($db->connect_error){
die("connection failed:".$db);
}
/*else{
echo "ok";
}*/
?>
<!DOCTYPE html>
<html>
<head>
<title>Quick Post</ti... | true |
a1528b1a11d08072effd26eac34063b9145533db | PHP | gitwzf/project_pc | /Testphp/ch04数据库/transfer.php | GB18030 | 2,174 | 2.875 | 3 | [] | no_license | <?php
//ӵݿ
$dbh = mysqli_connect("localhost:3308", "root", "12345", "phpbook") or die("ӵݿ");
//رԶύ
mysqli_autocommit($dbh, FALSE);
//תʼ
if ($_POST['submit'] && is_numeric($_POST['amt'])) {
//ӽĿ˻
$result = mysqli_query($dbh, "UPDATE accounts SET balance = balance + " . $_POST['amt'] . " WHERE id = " . $_POST['to']);
if... | true |
51012ec0a145626a82bc22ed04a9b6e96012bd66 | PHP | CazabetLyon1/openFoodFactVisu | /php/rechercheClusterProducts.php | UTF-8 | 2,416 | 2.59375 | 3 | [] | no_license | <?php
include_once "../config/config.php";
$mysqli = new mysqli(host, user, password, db);
if ($mysqli->connect_errno) {
echo "Sorry, this website is experiencing problems.";
echo "Error: Failed to make a MySQL connection, here is why: \n";
echo "Errno: " . $mysqli->connect_errno . "\n";
echo "Erro... | true |
844263c7bb4c2339241cc24e4598fca2cc38ffd5 | PHP | isurajmehra/VideoTube-website | /includes/classes/Account.php | UTF-8 | 3,584 | 3.078125 | 3 | [] | no_license | <?php
class Account{
private $con;
private $errorArray=array();
public function __construct($con){
$this->con=$con;
}
/*************for login or sign in *********/
public function login($un,$pw){
$pw=hash("sha512",$pw);
$query=$this->con->prepare("SELECT * from users WHERE username=:un and p... | true |
5aacf48a5093816598b68f1af9ce4debe980e4c6 | PHP | Chmieloo/PHPadventOfCode2018 | /Puzzles/Day11/PuzzlePartOne.php | UTF-8 | 1,523 | 3.453125 | 3 | [] | no_license | <?php
namespace Puzzles\Day11;
class PuzzlePartOne extends Puzzle
{
private $sum = 0;
private $cells = null;
private $powers = null;
private $gridSerial = 3999;
public function processInput()
{
for ($i = 1; $i <= 300; $i++) {
for ($j = 1; $j <= 300; $j++) {
... | true |
e1092089a3607a3aedd804680b03213fe8e11d6e | PHP | antonkar/dv-campus-2021-2022-php-framework | /src/data.php | UTF-8 | 3,637 | 2.890625 | 3 | [] | no_license | <?php
declare(strict_types=1);
function blogGetCategory(): array
{
return [
1 => [
'category_id' => 1,
'name' => 'Sports',
'url' => 'sports',
'posts' => [1, 2, 3]
],
2 => [
'category_id' => 2,
'name' ... | true |
fbee0c99e21814265dee707f932b15abaf9f25da | PHP | IvanValeroParicahua/TransportesAli | /src/Model/Entity/Ventum.php | UTF-8 | 856 | 2.59375 | 3 | [] | no_license | <?php
namespace App\Model\Entity;
use Cake\ORM\Entity;
/**
* Ventum Entity
*
* @property int $id
* @property int $reserva_id
* @property int $estado
* @property int $cantidad_personas
* @property int $precio
*
* @property \App\Model\Entity\Reserva $reserva
*/
class Ventum extends Entity
{
/**
* Fie... | true |
1b7a48678eb98e07be04e9cbc226806efd98f3b0 | PHP | gsgm0243/taller_1 | /taller_1/database/create_tables.php | UTF-8 | 474 | 2.703125 | 3 | [] | no_license |
<?php
include_once dirname(__FILE__) . '/conection.php';
$sql = "CREATE TABLE Persons
(
id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id),
identification INT,
name CHAR(15),
lastname CHAR(15),
email CHAR(200),
age INT
)";
if (mysqli_que... | true |
eec31de13df8f80f575128d3f2790b8c86a1f278 | PHP | elinoretenorio/php-headless-crud-for-movies-db | /src/Language/LanguageDto.php | UTF-8 | 481 | 3.0625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Movies\Language;
class LanguageDto
{
public int $languageId;
public string $languageCode;
public string $languageName;
public function __construct(array $row = null)
{
if ($row === null) {
return;
}
$this->languageId ... | true |
c3cb6e7ba0cd2880998ddf7f0dd8ef4b1ad6c9a4 | PHP | chrispynegar/ContentExpress-CMS | /library/helpers/system_helper.php | UTF-8 | 1,802 | 2.9375 | 3 | [] | no_license | <?php
if(!defined('SITE_ROOT')) exit('Direct access denied');
/**
* System helper
*
* Handles various system specific tasks
*
* @package Content Express CMS
* @author Chris Pynegar
*/
class System {
/**
* Redirect
*
* Redirects to another page
*
* @param string
* @return void
*/
public funct... | true |
b562e06393542095342ffe25c45a1748f7d1aa8e | PHP | firomero/octo-avenger | /src/Planillas/PaymentsBundle/Managers/PlanillasManager.php | UTF-8 | 6,963 | 2.765625 | 3 | [] | no_license | <?php
namespace Planillas\PaymentsBundle\Managers;
use Doctrine\ORM\EntityManager;
use Planillas\CoreBundle\Entity\CPlanillas;
use Planillas\CoreBundle\Entity\CPlanillasEmpleado;
use Symfony\Bridge\Monolog\Logger;
class PlanillasManager
{
/**
* @var \Doctrine\ORM\EntityManager $em
*/
private $em;... | true |
6dfc1587a42795c3817696fa5c8c5ca4f92bd56c | PHP | hoydaa/hoydaa.org | /lib/model/User.php | UTF-8 | 458 | 3.03125 | 3 | [] | no_license | <?php
class User extends BaseUser
{
public function setPassword($password)
{
$salt = md5(rand(100000, 999999).$this->getUsername().$this->getEmail());
$this->setSalt($salt);
$this->setSha1Password(sha1($salt.$password));
}
public function __toString()
{
return $this... | true |
2f69d1191a5dfa807ca0c52a642096a9e92bc058 | PHP | picamator/ProcessManager | /src/ProcessManager/ManagerInterface.php | UTF-8 | 1,239 | 2.875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/**
* Manager Interface
*
* @link https://github.com/picamator/ProcessManager
* @license http://opensource.org/licenses/BSD-3-Clause New BSD License
*/
namespace ProcessManager;
interface ManagerInterface
{
/**
* @param array $config
*/
public function __construct(array $c... | true |
1b910fad3183dc386b863e49ba29f295f312a2b3 | PHP | claytongf/CodeProject | /app/Services/ClientService.php | UTF-8 | 2,453 | 2.8125 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: Clayton
* Date: 08/11/2016
* Time: 13:13
*/
namespace CodeProject\Services;
use CodeProject\Repositories\ClientRepository;
use CodeProject\Validators\ClientValidator;
use Exception;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Database\QueryExc... | true |
ef534951041134a65c5f34cd813495cf08f73d47 | PHP | ydalbj/hz_laravel | /app/Admin/Controllers/GroupLevelController.php | UTF-8 | 2,714 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Admin\Controllers;
use App\Admin\Repositories\GroupLevel;
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Show;
use Dcat\Admin\Controllers\AdminController;
use Illuminate\Support\Facades\Request;
use App\Models\Group;
class GroupLevelController extends AdminController
{
/**
* Ma... | true |
686580e3626a669cd5e81f5953c5a9031478c672 | PHP | amethyst-php/file | /src/Repositories/FileRepository.php | UTF-8 | 902 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
namespace Amethyst\Repositories;
use Railken\Lem\Repository;
class FileRepository extends Repository
{
/**
* Find a file that have the path.
*
* @param string $path
*
* @return \Illuminate\Database\Query\Builder
*/
public function newQueryOneDiskPath($path)
{
r... | true |
58f4ecb49c5bf0fd704c824551cffa339d714fe2 | PHP | ZacMillionaire/mage | /system/main.php | UTF-8 | 4,005 | 2.71875 | 3 | [] | no_license | <?php
/*
9:20 PM - Rams: WHAT IS ONE WARNING AMONG BILLIONS
9:21 PM - hip musician w complicated shoes: you won't need compilers where we're going
*/
date_default_timezone_set('UTC');
// Lets makesure php isn't trying to fuck me
set_include_path(".");
require_once "config.php";
set_include_path($siteConfig["baseDir"]... | true |
538e84d0a9675f492e060d75011aca4b002c911f | PHP | rubelhassan/larubel | /larubel/libs/services/Response.php | UTF-8 | 660 | 2.75 | 3 | [] | no_license | <?php
namespace Larubel\Libs\Services;
class Response{
private static $baseUri;
private static $uri;
public static function redirect($url){
$url = self::$baseUri . $url;
header('Location: ' . $url);
die();
}
public static function getBasePath(){
return self::$ba... | true |
fd988470737704981cbf28b06653f72e33cf0277 | PHP | yoshiekiura/hyipis | /app/Observers/TransactionObserver.php | UTF-8 | 2,891 | 2.671875 | 3 | [] | no_license | <?php
namespace App\Observers;
use App\Models\Currency;
use App\Models\Transaction;
use App\Models\User;
/**
* Class TransactionObserver
* @package App\Observers
*/
class TransactionObserver
{
public function creating(Transaction $transaction)
{
$amount = $transaction->amount;
$currency... | true |
eb2d175408428efbce65dd72c16046096deebfe6 | PHP | WeareJH/ci-tool | /src/Commands/CommandInterface.php | UTF-8 | 200 | 2.609375 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace CITool\Commands;
interface CommandInterface
{
/**
* @throws \Exception
* @return int exit status
*/
public function execute(): int;
} | true |
d7e5753b27da60c2fd75b865e84b98f1643ffb91 | PHP | phuongnamsoft/auction | /dist/app/Http/Controllers/Api/AuthController.php | UTF-8 | 1,604 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Models\User;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Validator;
class AuthController extends BaseController {
public function __construct() {
}
public function login(Request $request) {
... | true |
cdcd5c69ca0e8daa677330c81832cb6d97ac041d | PHP | atsushiIMG/MailForm | /mission_6_entry.php | UTF-8 | 3,255 | 2.9375 | 3 | [] | no_license | <!-- <?php
// pre_memberの中身を見る箇所
// DB connect
$dsn='host';
$user='user';
$password = 'password';
$pdo = new PDO($dsn, $user, $password, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING));
$sql = $pdo -> query("SELECT * FROM pre_member");
$res = $sql -> fetchAll();
foreach($res as $row){
echo $row['... | true |
793fcfefb494c2d01bab6f3c85805c6fa975a974 | PHP | theguitarvity/Pizzago | /app/Funcionario.php | UTF-8 | 1,857 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class Funcionario extends Authenticatable
{
use Notifiable;
protected $guard = 'owner';
protected $nomeFuncionario;
protected $cpfFuncionario;
... | true |
7803e5c584946e54ce4ee13453d8dd3dda3dbd9f | PHP | WhiteSymmetry/sonar-php | /php-checks/src/test/resources/checks/formattingCheck/IndentationCheck.php | UTF-8 | 2,702 | 3.265625 | 3 | [] | no_license | <?php
/**
* Function calls arguments indentation
*/
doSomething($p1, // NOK {{Either split this list into multiple lines, aligned at column "4" or put all arguments on line "6".}}
$p2
);
doSomething(
$p1, $p2 // NOK {{Either split this list into multiple lines, aligned at column ... | true |
da366812cfa23c1d83c3322da15652031baacc8b | PHP | miltongiovanni/novaquim2 | /clases/DetFormulaMPrimaOperaciones.php | UTF-8 | 3,748 | 2.703125 | 3 | [] | no_license | <?php
class DetFormulaMPrimaOperaciones
{
private $_pdo; // Instance de PDO.
public function __construct()
{
$this->setDb();
}
public function makeDetFormulaMPrima($datos)
{
$qry = "INSERT INTO det_formula_mp (idFormulaMPrima, codMPrima, porcentaje)VALUES(?, ?, ?)";
$s... | true |
f7ccd3a7cb0fafc4ffdbb31b7c11c9f663976b7b | PHP | JulesvanDongen/Project-1.4 | /models/Locatie.php | UTF-8 | 1,070 | 2.625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace app\models;
use Yii;
/**
* This is the model class for table "locatie".
*
* @property integer $Locatie_ID
* @property string $Adres
* @property string $Postcode
* @property integer $Telefoon
*
* @property Hardware[] $hardwares
*/
class Locatie extends \yii\db\ActiveRecord
{
/**
* @i... | true |
0eaf9c209a3174438aa1e13f00d372c3ba0ddb92 | PHP | virginie-p/epic-friends | /controller/ResearchController.php | UTF-8 | 5,625 | 2.671875 | 3 | [] | no_license | <?php
namespace App\Controller;
use App\Model\UserManager;
use App\Model\SearchManager;
use App\Entity\Research;
class ResearchController extends Controller {
public function displaySearchEngine() {
if(isset($_SESSION['user'])) {
$user_manager = new UserManager();
$interests_center... | true |
87fb0514d5d719f6ab232cfc8384c8a4860db92d | PHP | revolucaodosbytes/ahoy-api | /app/Console/Commands/FetchProxy.php | UTF-8 | 4,848 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Console\Commands;
use App\Libs\PHPProxyChecker;
use App\Proxy;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\File;
use Telegram\Bot\Laravel\Facades\Telegram;
class FetchProxy extends Command
{
protected $name = "proxy:fetch";
/**
* The name and signature of the console comma... | true |
b49911680cd1bef095284f8cd5a174b6f46b0593 | PHP | stevekhanna/MovieTicketingWebsite | /signup.php | UTF-8 | 2,953 | 2.53125 | 3 | [] | no_license | <?php session_start(); ?>
<?php include('dbcon.php'); ?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header id="header">
<a class="logo" href="index.html">Ticket Booking System</a>
</header>
<div style ="height:575px"; class="form-wrapper" >
<form action="#" metho... | true |
2a6b6a1c1b0e4babf327270806ad9b91b3d3f2e6 | PHP | Bardyl/acf-custom-tables | /includes/Core/Utils/Database.php | UTF-8 | 4,185 | 3.03125 | 3 | [] | no_license | <?php
namespace AcfExtended\Core\Utils;
/**
* Interface between our ACF new database scheme implementation and $wpdb
*
* Class Database
* @package AcfExtended
*/
class Database {
private string $charsetCollate;
public string $prefix;
public function __construct() {
global $wpdb;
$th... | true |
6b46dd8627e4420a1679690e9a362ef09d623c63 | PHP | renearias/progravityback | /src/Multiservices/ArxisBundle/Validator/Constraints/UsernameValidator.php | UTF-8 | 1,052 | 2.546875 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | <?php
namespace Multiservices\ArxisBundle\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Doctrine\ORM\EntityManager;
use AppBundle\Entity\Usuario;
/**
* Description of UsernameValidator
*
* @author Rene Arias
*/
class UsernameValidator e... | true |
0d67300a76a40102d62b8bd0802324e0c61bea97 | PHP | ssabit/dsf | /api/api-form-types.php | UTF-8 | 1,830 | 2.5625 | 3 | [] | no_license | <?php
header('content.type: application/json');
$request=$_SERVER['REQUEST_METHOD'];
if($request=='GET'){
form_types_list();
}else if($request=='POST'){
$data=json_decode(file_get_contents('php://input'),true);
form_types_post($data);
}
else if($request=='PUT'){
$data=json_decode(file_get_contents... | true |
eb60b5c24840898c8c6b3d613bd3f1c729531f3e | PHP | bbearche/dekmartrades | /plugins/ChatMute/api.php | UTF-8 | 1,112 | 2.515625 | 3 | [] | no_license | <?php
require_once('util.php');
require_once('functions.php');
if (isset($_GET['action'])) {
switch($_GET['action']) {
case 'mute_list':
$results = chatmute_get_mute_names();
header('Content-Type: application/json');
echo json_encode($results);
break;
case 'list':
$results = chatmute_get_mutes();
h... | true |
090fff4ac0d2d39a6c7fc4405a0dc9c664cbb3d0 | PHP | kamitori/mega645 | /getdata.php | UTF-8 | 1,019 | 2.59375 | 3 | [] | no_license | <?php
session_start();
if(!isset($_SESSION['data'])){
require('phpexcel/Classes/PHPExcel.php');
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objReader->setReadDataOnly(true);
$objPHPExcel = $objReader->load('data.xlsx');
$objWorksheet = $objPHPExcel->getActiveSheet();
$highestRow = $objWorksheet... | true |
5263678c5848dc1bc6e499e46387c12e2f4cdf36 | PHP | SerafimArts/ffi-sdl | /src/Video/ArrayOrder.php | UTF-8 | 380 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Serafim\SDL\Video;
interface ArrayOrder
{
public const SDL_ARRAYORDER_NONE = 0;
public const SDL_ARRAYORDER_RGB = 1;
public const SDL_ARRAYORDER_RGBA = 2;
public const SDL_ARRAYORDER_ARGB = 3;
public const SDL_ARRAYORDER_BGR = 4;
public const SDL_ARRAY... | true |
f4942a81f0edef0fa265c968e5490d4a160a7e63 | PHP | vadimlekhter/Shop-PHP-2 | /models/Size.php | UTF-8 | 374 | 2.71875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: 123
* Date: 11.01.2019
* Time: 16:03
*/
namespace app\models;
class Size extends Record
{
public $id;
public $size;
/**
* Size constructor.
* @param $id
* @param $size
*/
public function __construct($id=null, $size=null)
{
... | true |
9da0e4fb69af522ad84b334db11b84e1c6d8cbe7 | PHP | ShaevMV/systo | /Backend/src/Order/InfoForOrder/Repositories/InMemoryMySqlTypesOfPayment.php | UTF-8 | 595 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Tickets\Order\InfoForOrder\Repositories;
use App\Models\Ordering\InfoForOrder\TypesOfPaymentModel;
use Tickets\Order\InfoForOrder\Response\TypesOfPaymentDto;
class InMemoryMySqlTypesOfPayment implements TypesOfPaymentInterface
{
public function __construct(
priva... | true |
8f7dd5457240c52e544769d9d7d029069aed3cae | PHP | resser001/halp | /app/controllers/GoogleSessionController.php | UTF-8 | 16,853 | 2.640625 | 3 | [] | no_license | <?php
class GoogleSessionController extends BaseController {
// ------------------------------------------------------------------------
static function getCreds() {
$creds = null;
$creds_file = [];
$google_creds = Config::get('config.google');
$env = Config::getEnvironment();
$jsonfile = null;
... | true |
3370e06d9a56c78f2b5cdbe6accb039f399d2e9e | PHP | apdalah/lara-farm | /app/Http/Controllers/FieldController.php | UTF-8 | 944 | 2.53125 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Field;
use App\Plant;
class FieldController extends Controller
{
public function index()
{
$fields = Auth::guard('farmer')->user()->fields;
$plants = Plant::all();
return view('field... | true |
da1d6a9bb44b2c5b1a79d14a02f9877fa5b78149 | PHP | Karinacho/SoftUni | /Programming Fundamentals/PHP/PHP Functions Exercise Solutions/charInRange.php | UTF-8 | 215 | 3.46875 | 3 | [] | no_license | <?php
$a=readline();
$b=readline();
function charRange($a,$b){
$min=min(ord(($a)),ord($b));
$max=max(ord(($a)),ord($b));
for($i=$min+1;$i<$max;$i++){
echo chr($i)." ";
}
}
charRange($a,$b); | true |
8c76ff05ab11d62a0c8206304623c916b05e6c0d | PHP | Jk1979/housesearch | /app/Http/Controllers/HouseController.php | UTF-8 | 1,120 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\House;
use Illuminate\Support\Facades\DB;
class HouseController extends Controller
{
public function search(Request $request){
if($request->isMethod('post')){
$result = DB::table('houses');
if($request->filled('name... | true |
729e04452449aa9b8312a154d85700bd95f54446 | PHP | DefrostedTuna/viiidb-api | /app/Services/TestQuestionService.php | UTF-8 | 483 | 2.625 | 3 | [] | no_license | <?php
namespace App\Services;
use App\Contracts\Services\TestQuestionService as TestQuestionServiceContract;
use App\Models\TestQuestion;
class TestQuestionService extends ModelService implements TestQuestionServiceContract
{
/**
* Create a new TestQuestionService instance.
*
* @param TestQuestion... | true |
b4de3f9c6993f654fe27564bf188267677de8e23 | PHP | anagduran/TDDPHP | /src/Cuenta.php | UTF-8 | 2,724 | 3.0625 | 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.
*/
/**
* Description of Cuenta
*
* @author ana
*/
class Cuenta {
//put your code here
private $saldo;
pu... | true |
43f2d87747c06d5d9f1f96bff6548549545b5572 | PHP | NFQ-Makers/api | /src/Observers/Observer.php | UTF-8 | 673 | 3.015625 | 3 | [] | no_license | <?php
namespace Observers;
use Observers\Subject;
abstract class Observer
{
/**
* @param null $subject
*/
public function __construct($subject = null)
{
if (is_object($subject) && $subject instanceof Subject) {
$subject->attach($this);
}
}
/**
* On subje... | true |
ee35168e3dfada85e6a204aa9c4917ae975b7fc5 | PHP | ihilt/php-petango | /src/StructType/AdoptableDetails.php | UTF-8 | 2,820 | 2.953125 | 3 | [] | no_license | <?php
namespace StructType;
use \WsdlToPhp\PackageBase\AbstractStructBase;
/**
* This class stands for AdoptableDetails StructType
* @subpackage Structs
*/
class AdoptableDetails extends AbstractStructBase
{
/**
* The animalID
* Meta informations extracted from the WSDL
* - maxOccurs: 1
* ... | true |
0bb8eed4042282f7be9ebaa9c5070bde2e579e58 | PHP | AnTer284/test.job | /database/seeds/EmployeeTableSeeder.php | UTF-8 | 1,358 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use App\Employee;
class EmployeeTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Employee::insert([
'first_name' => 'Иван',
'last_name... | true |
0e22eeffe5fffccc94f04f627f9ac0031f6eabdc | PHP | tiennguyen2012/vstcat.com | /application/modules/admin/controllers/UserController.php | UTF-8 | 720 | 2.578125 | 3 | [] | no_license | <?php
class Admin_UserController extends Coco_Controller_Action_Admin {
public function init(){
parent::init();
$this->_helper->layout->disableLayout();
}
/**
* Action to user login. User login need is admin
* @author tien.nguyen
*/
public function loginAction(){
$form = new Admin_Form_FormLogin(... | true |
2ba74f28536e5c2dd415cef07417a17649c5e247 | PHP | eightbitdave/social-app | /app/Http/Controllers/UsersController.php | UTF-8 | 4,707 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php namespace App\Http\Controllers;
use DB;
use Auth;
use Hash;
use Request;
use Session;
use App\Post;
use Redirect;
use Validator;
use App\User;
use App\Http\Requests;
use App\Http\Controllers\Controller;
class UsersController extends Controller {
public function __construct()
{
$this->middleware('auth', ['... | true |
975ad724ed18871da1821f02a23a0e2f228ffe1b | PHP | naymic/passwords | /storage/model.php | UTF-8 | 931 | 3.34375 | 3 | [] | no_license | <?php
abstract class Model{
protected $tableName;
/**
* Every Model child needs to know how to
* validate his own variables
*/
public abstract function validation();
public function existAtribute($classObject, $atributeName){
$reflect = new ReflectionClass($classObject);
$array = $reflect... | true |
aabb7bb09fbda79b19d000d9bfbd92b9fd85a914 | PHP | tunacardak/proje | /hm.php | UTF-8 | 1,017 | 3.03125 | 3 | [] | no_license | <html>
<body>
<div>
<?php
if(isset($_POST['submit']))
{
if(is_numeric($_POST['sayi1']) && is_numeric($_POST['sayi2']))
{
if($_POST['islem'] == 'topla')
{
$sonuc = $_POST['sayi1'] + $_POST['sayi2'];
}
if($_POST['islem'] == 'cikar')
{
$sonuc = $_POST['sayi1'] - $_POST['sayi2'];... | true |
3e55fc1574ab05a8e8a53df29636bb090b773831 | PHP | justclimber/climbnet | /app/Lib/Dicts/RouteCategories.php | UTF-8 | 691 | 2.96875 | 3 | [] | no_license | <?php
namespace App\Lib\Dicts;
class RouteCategories implements DictInterface
{
const CATEGORY_MIN = 5;
const CATEGORY_MAX = 9;
public function getName()
{
return 'categories';
}
public function getDict()
{
$dict = [];
$categoryIndex = self::CATEGORY_MIN;
... | true |
f98b80a6d771006cdb66ecd948b8f309f2ea7fd2 | PHP | wilki-space/bitflyer-realtime-board | /getBoardInfo.php | UTF-8 | 2,848 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
/**
* Bitflyer リアルタイム板情報取得
*/
require_once('vendor/autoload.php');
use PubNub\PubNub;
use PubNub\Enums\PNStatusCategory;
use PubNub\Callbacks\SubscribeCallback;
use PubNub\PNConfiguration;
class MySubscribeCallback extends SubscribeCallback {
private $askBoardInfo = []; # 売り板
private $bidBoardI... | true |
444af4f97f04b406b44bdb4e7a9fb1b317d068b5 | PHP | Enakoneschniy/php-example | /lesson4/index.php | UTF-8 | 2,185 | 3.546875 | 4 | [] | no_license | <?php
$arExapmle = array(
1 => 23, 49, 80
);
var_dump($arExapmle);
echo "<br>-------------------------------------------------<br>";
$num = 1;
while($num <= 10){
echo $num++, ", ";
}
echo "<br>===================<br>";
do{
echo $num++, ", ";
}while($num <= 1);
echo "<br>-------------------------------... | true |
f30c9777504e08775702860edfdc0c7b3aea320b | PHP | electric-eloquence/fepper-drupal | /backend/drupal/core/lib/Drupal/Core/Menu/LocalActionManagerInterface.php | UTF-8 | 1,216 | 2.703125 | 3 | [
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-other-copyleft",
"GPL-2.0-or-later",
"GPL-2.0-only",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
namespace Drupal\Core\Menu;
use Drupal\Component\Plugin\PluginManagerInterface;
/**
* Manages discovery and instantiation of menu local action plugins.
*
* Menu local actions are links that lead to actions like "add new". The plugin
* format allows them (if needed) to dynamically generate a title or the pa... | true |
da7c6f414ff24e0887b7f1a31f132992323a02c5 | PHP | TanukaN/RefactorActiveRecord | /string_HtmlFunctions/htmlTags.php | UTF-8 | 596 | 2.703125 | 3 | [] | no_license | <?php
namespace string_HtmlFunctions;
class htmlTags {
static public function tableFormat() {
echo "<table cellpadding='5px' border='1px' style='border-collapse: collapse'>";
}
static public function tableHeader($text) {
echo '<th>'.$text.'</th>';
}
... | true |
762ea0c826ae66bb778660935f1164b5e7dde52a | PHP | tabbi89/CommanderBundle | /Event/EventGenerator.php | UTF-8 | 706 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php
namespace Tabbi89\CommanderBundle\Event;
/**
* Aggregates can use this trait to raise and harbor events to be released later to the dispatcher.
*
* @package Tabbi89\CommanderBundle\Event
*/
trait EventGenerator
{
/**
* Events list
*
* @var array
*/
protected $pendingEvents = [];
... | true |
00ba370d88741962e4ec68442f0087a6a814a25d | PHP | yafithekid/order-transaction | /app/Domains/Repos/TransactionProductRepo.php | UTF-8 | 791 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Domains\Repos;
use App\Models\Product;
use App\Models\Transaction;
use App\Models\TransactionProduct;
interface TransactionProductRepo
{
/**
* @param Transaction $transaction
* @param Product $product
* @return TransactionProduct
*/
function findByTransactionAndProduc... | true |
aeead15e6f08e8a27c444c7962039030610ed565 | PHP | rex2002xp/framework | /core/config.php | UTF-8 | 692 | 2.90625 | 3 | [] | no_license | <?php
namespace core;
/**
* Objeto para administrar los parametros de configuracion de la aplicacion.
*
* @author Victor Hugo Cornejo Calderon <victor.cornejo@iguanadas.com>
* @package core
*/
class Config {
private $_file;
/**
* Objeto para administrar los parametros de... | true |
0866331e5fb58bd7c2e63aa3a3b85541b863923c | PHP | mbaharul/iPerformance | /app/Models/Auth/DepartmentKpi.php | UTF-8 | 585 | 2.515625 | 3 | [] | no_license | <?php
namespace App\Models\Auth;
use Illuminate\Database\Eloquent\Model;
class DepartmentKpi extends Model
{
public $timestamps = false;
protected $table = 'department_kpi';
protected $primaryKey = 'department_kpi_id';
protected $fillable = [
'employee_id',
'department_level_kpi_id',
'date',
'weightage',... | true |