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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
187260009e993b560cd67cac471151cdec88166b | PHP | samhol/SPHP-framework | /sphp/php/tests/classes/Sphp/Tests/Documentation/Linkers/PHP/NamespaceLinkerTest.php | UTF-8 | 2,565 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
/**
* SPHPlayground Framework (http://playgound.samiholck.com/)
*
* @link https://github.com/samhol/SPHP-framework for the source repository
* @copyright Copyright (c) 2007-2020 Sami Holck <sami.holck@gmail.com>
* @license https://opensource.org/licenses/MIT The MIT License
... | true |
221c8bb040cebb1c390ae18a6a048cf9cb4f58ec | PHP | KeeperJerry/L-Shop-remade | /app/DataTransferObjects/Frontend/Shop/Catalog/Product.php | UTF-8 | 840 | 2.78125 | 3 | [] | no_license | <?php
declare(strict_types = 1);
namespace app\DataTransferObjects\Frontend\Shop\Catalog;
use app\Entity\Product as Entity;
class Product implements \JsonSerializable
{
/**
* @var Entity
*/
private $entity;
/**
* @var bool
*/
private $inCart;
public function __construct(Enti... | true |
9256b58380d7a6fad975df93d39bf2b1178a05e8 | PHP | shaytamir/MadAnima | /project/app/Models/Products.php | UTF-8 | 3,918 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Session;
// use Illuminate\Support\Facades\Cart;
// use Session;
use Image;
use Darryldecode\Cart\Facades\CartFacade as Cart;
// use Darryldecode\Cart\Cart ;
cla... | true |
5ca64367102b8826df7f498b0373caa0907c4b9c | PHP | SarahIllilten/My_Deezer | /Controller/ErrorController.php | UTF-8 | 483 | 2.625 | 3 | [] | no_license | <?php
class ErrorController extends Controller {
public function mainAction() {
$error = ['error_message' => 'Invalid request.', "results" => [], "status" => "INVALID_REQUEST"];
exit(json_encode($error, JSON_FORCE_OBJECT | JSON_PRETTY_PRINT));
}
public function invalidArgumentAction() {
$error = [... | true |
83cb71812968eb9ae0375d6c048163c982fd10c5 | PHP | JohanDeLijser/Pagebuilder | /database/migrations/2018_12_06_152307_create_pageblockfields_table.php | UTF-8 | 867 | 2.546875 | 3 | [] | no_license | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePageblockfieldsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (!Schema::hasTable('... | true |
634762bdbc54c7c68faf23437db826b797df1ca9 | PHP | Willyan-15/norteando | /outros/contrato.php | UTF-8 | 727 | 3.046875 | 3 | [] | no_license |
<?php
require_once("_con.php");
$connect = mysqli_connect($host,$user,$pass,$db);
if($connect)
{
echo "conectou";
}
else{
echo "nao abriu o banco";
}
$sql = "SELECT data_inicio,data_termino,valor_contrato FROM contrato";
$consulta = mysqli_query($connect,$sql);
echo '<table>';
echo '<tr>';
echo '<td... | true |
78ccab0b6f33b259b49afca486d15ef382c25353 | PHP | microsoftgraph/msgraph-sdk-php | /src/Beta/Microsoft/Graph/SecurityNamespace/Model/RuleSchedule.php | UTF-8 | 2,248 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
/**
* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
*
* RuleSchedule File
* PHP version 7
*
* @category Library
* @package Microsoft.Graph
* @copyright (c) Microsoft Corporation. All rights reserved.
* @lic... | true |
bbd6f62a1cfd0fce0a6a6f65f91070b83fe002bf | PHP | xrowgmbh/OData_PHP_SDK | /framework/Common/Collection.php | UTF-8 | 3,637 | 3.015625 | 3 | [
"Apache-2.0"
] | permissive | <?php
/*
Copyright 2010 Persistent Systems Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable la... | true |
df9ed58d3acf07c99280454490f36a65ef77f6ce | PHP | mfalemany/aulasfca | /rest/rest.php | UTF-8 | 1,408 | 2.890625 | 3 | [] | no_license | <?php
if( ! defined('INICIO')){ die('No se permite acceder directamente al script');}
class Rest{
protected $conexion;
function __construct(){
$this->conexion = new Adaptador();
}
function clases($fecha = NULL){
$fecha = ($fecha) ? $fecha : date('Y-m-d');
$resumen = $this->conexion->get_cronograma_diario($... | true |
316b16b2b927c335df7ad5950c7e40491990aa76 | PHP | gglinux/Yii2-Plus | /vendor/nikic/php-parser/lib/PHPParser/Node/Stmt/Declare.php | UTF-8 | 801 | 2.875 | 3 | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive | <?php
/**
* @property PHPParser_Node_Stmt_DeclareDeclare[] $declares List of declares
* @property PHPParser_Node[] $stmts Statements
*/
class PHPParser_Node_Stmt_Declare extends PHPParser_Node_Stmt
{
/**
* Constructs a declare node.
*
* @param PHPParser_Node_Stmt_DeclareDec... | true |
e6ae91e712a96643a3423bc3b2457df5ad499523 | PHP | AdrianBenetti/dublagem | /conexao.php | UTF-8 | 679 | 2.59375 | 3 | [] | no_license | <?php
// CONEXAO COM O BANCO DE DADOS E ARMAZENAMENTO DAS VARIAVES
$link = mysqli_connect("localhost", "root", "", "mensagem");
if (!$link) {
echo "Error: Falha ao conectar-se com o banco de dados MySQL." . PHP_EOL;
echo "Debugging errno: " . PHP_EOL;
echo "Debugging error: " . PHP_EOL;
exit;
}
if(!empty($_POST['envi... | true |
1db182f13f97312b2304cb9f09c09f9482d1497c | PHP | ouracademy/repuestop | /app/Domain/Repository/TransferenceRepository.php | UTF-8 | 251 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php namespace App\Domain\Repository;
/**
*
* @author pc
*/
use App\Domain\Entities\Transference;
interface TransferenceRepository {
public function getAll();
public function find($id);
public function store (Transference $data);
}
| true |
7ae7d3f59c47a5558035b774d98fe50e71f45031 | PHP | MCZbase/datashot_php_image | /imagelib.php | UTF-8 | 4,425 | 2.890625 | 3 | [] | no_license | <?php
/**
* imagelib.php
*
* Supporting functions for image delivery.
*
* Copyright © 2013 President and Fellows of Harvard College
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of Version 2 of the GNU General Public License
* as published by the Free Software Foundatio... | true |
e4be0696354f2f2dfca3a470e154e4a2246cd355 | PHP | briannesbitt/Carbon | /src/Carbon/Traits/Mutability.php | UTF-8 | 1,317 | 3.1875 | 3 | [
"MIT"
] | permissive | <?php
/**
* This file is part of the Carbon package.
*
* (c) Brian Nesbitt <brian@nesbot.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Carbon\Traits;
use Carbon\Carbon;
use Carbon\CarbonImmutable;
/**
* Trait ... | true |
da8e39861a9f5389d6ad51ea543627ebc9a34b6a | PHP | comem/rockit | /app/tests/authentificationTest.php | UTF-8 | 1,158 | 2.5625 | 3 | [] | no_license | <?php
class authentificationTest extends TestCase {
///////////////////////////// Test for login ////////////////////////////////////
public function test_login()
{
$response = $this->call('POST', 'v1/login', array('remember' => 'true', 'email' => 'guzi@guzi.ch', 'password' => 'guzi'));
// $response = $thi... | true |
f382787bc77a5ed236ea50e3a9ff098c675333a7 | PHP | SokaJamur/WebSoka | /application/models/admin/artikel_model.php | UTF-8 | 512 | 2.546875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
class artikel_model extends CI_Model{
public function __construct(){
parent::__construct();
}
function tampil(){
$query = $this->db->get('artikel');
return $result = $query->result_array();
}
public function get_artikel_by_id($id){
$query = $this->db->get_where('artikel', array('ID_ARTIKEL' => $... | true |
d918168509f0e92f24da7dc3549e80d7394bb22f | PHP | mohamedaliff/semutkecil | /loginFunction.php | UTF-8 | 1,408 | 2.546875 | 3 | [] | no_license | <?php
ini_set('display_errors',1);
error_reporting(E_ALL);
@session_start();
include ('Connections/connect.php');
if(isset($_POST['submit2']))
{
$username = $mysqli->real_escape_string($_POST['txtUsername']);
$password = $mysqli->real_escape_string($_POST['txtPassword']);
if ($username == "" || $password == ""... | true |
690b9f828af4730cb93d48aa0e9149462c96ab6f | PHP | qdesmurs/ps_module_qdtestimonials | /classes/QdPost.php | UTF-8 | 641 | 2.515625 | 3 | [] | no_license | <?php
class QdPost extends ObjectModel
{
public $id_qdtestimonials;
public $qdtestimonials_date;
public $qdtestimonials_author;
public $qdtestimonials_content;
public static $definition = array(
'table' => 'qdtestimonials',
'primary' => 'id_qdtestimonials',
'fields' => array... | true |
5d90bb79c6279ef5644f21e6341063cb37f667f7 | PHP | zakariak/avgform-git | /avgform/php/json.php | UTF-8 | 1,264 | 2.53125 | 3 | [] | no_license | <?php
$XMLFilePath = '../javascript/form.xml';
function parse($url) {
$getFile = file_get_contents($url);
$xmlString = simplexml_load_string($getFile);
$json = json_encode($xmlString, JSON_PRETTY_PRINT);
return $json;
}
function parseXmlQuestions($url) {
$xmlString = file_get_contents($url)... | true |
784cc8b31bb57134fca90621161d059e7ed81654 | PHP | baniol/gotin | /models/user.php | UTF-8 | 902 | 2.96875 | 3 | [] | no_license | <?php
/**
* User Model
*
* @license http://www.opensource.org/licenses/mit MIT License
* @link http://bundles.laravel.com/bundle/gotin
* @filesource
* @author Marcin Baniowski
* @package Gotin\Models
*/
class User extends Eloquent
{
public static $timestamps = true;
/**
*
* @return ... | true |
7db4e55806ccce5d9d51ca3299d712731df6fa8c | PHP | falcard/McMurry-University-Course-Conflict-Program | /parse.php | UTF-8 | 2,765 | 3.25 | 3 | [] | no_license | <?php
require 'data-maker.php';
// create variables to collect the data
$department = $_POST['department'];
$course = $_POST['classID'];
// get location of POST variable classID
for ($i = 0; $i < $dataLength; $i++)
{
if ($dataArray[$i][2] == $department and $dataArray[$i][1] == $course)
{
$courseNAM... | true |
2e16923b4280ad554022af43a772db51c9c5d4f1 | PHP | vfremaux/moodle-format_page | /plugins/choice.php | UTF-8 | 4,304 | 2.546875 | 3 | [] | no_license | <?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle ... | true |
26ca575b53ca5a13b2229c02cdb85a3166c1de38 | PHP | Eriknag/ontwebframework | /modules/my_module/model/testmodel.class.php | UTF-8 | 692 | 2.578125 | 3 | [] | no_license | <?php
class testModel {
private $site;
public $teststring;
public function __construct($site) {
$this->site = $site;
$res = $this->site->mysqli->query("SELECT * FROM user WHERE username='".$site->account->getCurrentUser()->username."'");
$usertel = $res->fetch_assoc()['telephone'];
$th... | true |
1dae931d63cf718f5ca2000886e60db443f9164a | PHP | marinusjvv/sudokuSolver | /src/Meta/BoardMetaData.php | UTF-8 | 1,050 | 2.75 | 3 | [] | no_license | <?php
namespace MarinusJvv\Sudoku\Meta;
use MarinusJvv\Sudoku\Board\Board;
use MarinusJvv\Sudoku\Board\Containers\Row;
use MarinusJvv\Sudoku\Board\Utilities\SectionPositionCalculator;
class BoardMetaData
{
/**
* @param Board $board
* @param $row
* @param $column
* @param $value
*/
pu... | true |
39b50b35b12b465b7efb9bed116058639ced473f | PHP | xtrdnrmnd/Simple_security_site | /empadd.php | UTF-8 | 2,145 | 2.578125 | 3 | [] | no_license | <html>
<head>
<title>Сеанс</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<link rel="stylesheet" href="stylesheet.css">
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet">
<body class="first">
<body>
<center><font size="25">Служба безо... | true |
23dbc0d37f2431ebeccde6596a86c46589ac4087 | PHP | phphants/phph-site | /src/App/Validator/UserDoesNotExistValidator.php | UTF-8 | 1,165 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types = 1);
namespace App\Validator;
use App\Service\User\Exception\UserNotFound;
use App\Service\User\FindUserByEmailInterface;
use Zend\Validator\AbstractValidator;
final class UserDoesNotExistValidator extends AbstractValidator
{
const USER_EXISTS = 'userExists';
protected $messageTe... | true |
63e1b3ee07c561b5923b228f269d9f825aa8f222 | PHP | ciniki/customers | /public/ifbUpgrade.php | UTF-8 | 30,181 | 2.53125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
//
// Description
// -----------
// This method will upgrade the customers database to the IFB mode (Individuals, Families, Businesses)
//
// Arguments
// ---------
//
// Returns
// -------
//
function ciniki_customers_ifbUpgrade(&$ciniki) {
//
// Find all the required and optional arguments
//
... | true |
9e9543500a18c69923ad7ff910c9821b844a45f5 | PHP | beveradb/aas-custom-score-system | /wp-content/plugins/scoresystemmanager/scoresystemmanager.php | UTF-8 | 24,321 | 2.59375 | 3 | [] | no_license | <?php
/*
Plugin Name: Score System Manager
Plugin URI: http://www.abingdonauntsally.com
Description: A plugin created to manage the Score System for Abingdon Aunt Sally Association.
Version: 1.0
Author: Andrew Beveridge
Author URI: http://www.andrewbeveridge.co.uk
License: GPLv3
*/
global $wpdb;
if (isse... | true |
84349127425c3f87d167120124f33a649e90e71e | PHP | EngineersUNILAKERS/Projeto_EngCompUnilago | /devtools/TestesBanco.php | UTF-8 | 1,605 | 2.984375 | 3 | [] | no_license | <?php
require('../config.php');
require('../ConsultasSql.php');
$ConsultasBanco = new ConsultasBanco;
//Exemplo de select
$sql="SELECT Nome FROM USERS";
$result=mysqli_query($ConsultasBanco->ConectarBanco(),$sql);
//Imprimindo o resultado
// while($nome = mysqli_fetch_assoc($result))
// {
// // echo $nome['Nome'].... | true |
cf9ece92bd0fbed3f3177427523b9f21bac48a27 | PHP | Unice-SIL/syllabus | /src/Syllabus/Import/Matching/CourseInfoCsvMatching.php | UTF-8 | 8,985 | 2.671875 | 3 | [] | no_license | <?php
namespace App\Syllabus\Import\Matching;
use App\Syllabus\Constant\TeachingMode;
use App\Syllabus\Entity\Course;
use App\Syllabus\Entity\CourseInfo;
use App\Syllabus\Entity\Structure;
use App\Syllabus\Entity\Year;
use App\Syllabus\Helper\Report\Report;
use App\Syllabus\Helper\Report\ReportLine;
use App\Syllabus... | true |
8b3ba6d60dca6360ed739ce81a5be154cfd179ed | PHP | etic4/mini-trello-php | /controller/BreadCrumb.php | UTF-8 | 2,112 | 3.203125 | 3 | [] | no_license | <?php
require_once "autoload.php";
class BreadCrumb {
private array $breadcrumb;
private ?string $last_elem;
public function __construct(array $trace, string $last_elem=null) {
$this->breadcrumb = $trace;
$this->last_elem = $last_elem;
}
// Construit et retourne le breadcrumb
... | true |
2bcc870e9b66581b11922dd6847d43531aefdb55 | PHP | rootdevelopper/ReportsGenerator | /src/GoogleDriveFileUploader.php | UTF-8 | 3,066 | 2.859375 | 3 | [] | no_license | <?php
namespace AutomatedReports;
class GoogleDriveFileUploader{
private $client;
function getClient() {
$this->client = new \Google_Client();
$this->client->setApplicationName(APPLICATION_NAME);
$this->client->setScopes(SCOPES);
$this->client->setAuthConfig(CLIENT_SECRET_PATH);
$this->clien... | true |
6633baf78aab12c9d3923876a3b9bc98d41b9b33 | PHP | theperfectcoder/rrapp | /app/Models/Email/Email.php | UTF-8 | 608 | 2.578125 | 3 | [] | no_license | <?php
namespace App\Models\Email;
use App\Models\Service\Service;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
/**
* Class Email
* @package App\Models\Email
*/
class Email extends Model
{
/**
* @var string
*/
protected $table = 'emails';
... | true |
60cb600c5e2621e9722f3b3af84f899fc3db4ea5 | PHP | hamrithy/CoffeeShopPro | /application/models/dto/DtoFood.php | UTF-8 | 1,690 | 2.90625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
class DtoFood{
private $foodid;
private $title;
private $description;
private $thumbnailurl;
private $promotiontype;
private $price;
private $userid;
private $foodtypeid;
private $seotitle;
private $seodescription;
public function getFoodid(){
return $this->foodid;
}
public function setFoodid(... | true |
986a2ccdf11efc7871f5b8f143482794833078e4 | PHP | skydotint/smartcampus | /application/models/Results_model---30.php | UTF-8 | 8,702 | 2.53125 | 3 | [] | no_license | <?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Results_model extends Common_model {
function __construct() {
parent::__construct();
}
public function getAllMarks($table, $where) {
$sql = $this->db->get_where($table, $where);
foreach ($sql->resul... | true |
5443e9d79901a3d7502b065b444323ea6e6bbfc0 | PHP | sasin91/Laravel-routes | /src/LaravelRouteServiceProvider.php | UTF-8 | 744 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace Sasin91\LaravelRoutes;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\ServiceProvider;
use Sasin91\LaravelRoutes\Commands\MakeRouteCommand;
class LaravelRouteServiceProvider extends ServiceProvider
{
public function boot()
{
$this->commands(MakeRouteCommand::class);
}
public func... | true |
ae1e4a9beaf01e6ff631da1fff719488c77be460 | PHP | SticksInHand/phpbasic | /where.php | UTF-8 | 421 | 2.546875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: M.Jin
* Date: 14-7-24
* Time: 下午5:51
*/
$con = mysql_connect("127.0.0.2","root","");
if(!$con)
{
die('Could not connect: '.mysql_error());
}
mysql_select_db('my_db',$con);
$result = mysql_query("SELECT * FROM Persons WHERE FirstName = 'Peter'");
while($row = mysql_f... | true |
1c7f9393a1ab43dc5da1f4b55db87106a2b06788 | PHP | rails-hub/todd_bullgame | /application/classes/Model/leaderboard.php | UTF-8 | 1,531 | 2.734375 | 3 | [
"BSD-3-Clause"
] | permissive | <?php defined('SYSPATH') OR die('No direct access allowed.');
class Model_Leaderboard extends ORM
{
public function rules()
{
return array(
'user_id' => array(
array('not_empty')
),
'score' => array(
array('not_empty')
)
... | true |
cb241fae40e642c7e94e3305ee93de28e8c1a064 | PHP | dichevia/Programming-Fundamentals-with-PHP | /Arrays Advanced/Arrays Advanced - More Exercise/04. Drum Set.php | UTF-8 | 816 | 3.15625 | 3 | [] | no_license | <?php
$savings = floatval(readline());
$drumSet = array_map('intval', explode(' ', readline()));
$initialDrumSet = $drumSet;
$hitPower = readline();
while ($hitPower !== "Hit it again, Gabsy!") {
$hitPower = intval($hitPower);
for ($i = 0; $i < count($drumSet); $i++) {
$drumSet[$i] -= $hitPower;
... | true |
bc4322d27257f91553aa9bd3b0b5a0518070530b | PHP | hi-noikiy/project | /91ns/apps/models/GiftPackageConfigs.php | UTF-8 | 678 | 2.59375 | 3 | [] | no_license | <?php
namespace Micro\Models;
//礼包配置表
class GiftPackageConfigs extends \Phalcon\Mvc\Model {
/**
*
* @var integer
*/
public $id;
/**
*
* @var string
*/
public $name;
/**
*
* @var string
*/
public $desc;
/**
*
* @var string
*/
... | true |
11871f63de1c60f75aeb07ef60cc0cdd4faef017 | PHP | hyungju-lee/php | /php/061-ceil.php | UTF-8 | 66 | 2.75 | 3 | [] | no_license | <?php
$num = 12.38;
$ceil = ceil($num);
echo $ceil
?>
| true |
9ac6c962250dc26981414abb4c7887aece40a18a | PHP | SamRocha3/Calculadora | /calc/opShare.php | UTF-8 | 446 | 3.59375 | 4 | [] | no_license | <?php
class OpShare
{
private $first_number;
private $second_number;
public function __construct(float $numb1, float $numb2)
{
$this->first_number = $numb1;
$this->second_number = $numb2;
}
public function calculate()
{
if($this->second_number == 0) throw new Inval... | true |
03650bf1dad06ab6e21001d917a8b974bd99cd7f | PHP | kapil98arora/Ecommerce | /newtest.php | UTF-8 | 654 | 2.75 | 3 | [] | no_license | <?php
session_start();
/*
* 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.
*/
/*$a=43;
$b="2";
sum($a,$b);
function sum($a,$b){
echo $a+$b;
}
for($key=1;$key<=10;$key++)
{
$t=2*$key;
... | true |
0915088482102efa490721772740510dac244908 | PHP | panda4man/CSE3241 | /app/database/seeds/BooksTableSeeder.php | UTF-8 | 657 | 2.890625 | 3 | [
"MIT"
] | permissive | <?php
// Composer: "fzaninotto/faker": "v1.3.0"
use Faker\Factory as Faker;
class BooksTableSeeder extends Seeder {
public function run()
{
//remove all rows
DB::table('books')->delete();
//create faker handle
$faker = Faker::create();
foreach(range(1, 30) as $index)
{
Book::create(array(
'is... | true |
103d47f2d4c1e40958bd4e96fe8de15afaac43ab | PHP | just-tom/planets-api | /src/Repositories/GasRepository.php | UTF-8 | 1,820 | 2.734375 | 3 | [] | no_license | <?php
namespace EMS\Repositories;
use Silex\Application;
class GasRepository
{
protected $app;
protected $queryBuilder;
public function __construct(Application $application)
{
$this->app = $application;
$this->queryBuilder = $application['db']->createQueryBuilder();
}
public... | true |
9a8d69ba1a13a75da77270f549f54befef6373aa | PHP | gurov-itstep-php/beauty-saloon | /app/forms/regform.php | UTF-8 | 636 | 2.5625 | 3 | [] | no_license | <?php
namespace app\forms;
use \sys\core\Form as Form;
use \sys\lib\Field as Field;
class Regform extends Form {
public function __construct() {
$this->name = 'regform';
$this->className = 'reg-form';
$this->methodName = 'post';
$this->actionPath = '#';
$this->enctype = '... | true |
8c5a3981390a37243e60e89c34c7a0107e25c050 | PHP | tankist/yii-qs | /lib/web/controllers/filters/QsFilterSecureConnection.php | UTF-8 | 2,285 | 2.890625 | 3 | [
"MIT"
] | permissive | <?php
/**
* QsFilterSecureConnection class file.
*
* @author Paul Klimov <pklimov@quartsoft.com>
* @link http://www.quartsoft.com/
* @copyright Copyright © 2010-2013 QuartSoft ltd.
* @license http://www.quartsoft.com/license/
*/
/**
* Filter, which allows access to the action using only
* certain connec... | true |
b87cbcfa34e050b33156b00451a855f620b77ec5 | PHP | 643141017/applcon_shop | /core/common/library/Providers/SessionServiceProvider.php | UTF-8 | 1,601 | 2.53125 | 3 | [] | no_license | <?php
namespace Applcon\Common\Library\Providers;
use Phalcon\Session\Adapter\Files;
/**
* \Applcon\Common\Library\Providers\SessionServiceProvider
*
* @package Applcon\Common\Library\Providers
*/
class SessionServiceProvider extends AbstractServiceProvider
{
const UNIQUE_ID = 'applcon_';
/**
* The... | true |
e9141095f3211043e996b67362f7b733dec9b0dd | PHP | kuro1907/bus-manager | /app/Repositories/Contracts/SchedulesRepository.php | UTF-8 | 220 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Repositories\Contracts;
interface SchedulesRepository {
public function getAll();
public function getGroup($route_name_id, $group_number);
public function getRouteName($route_name_id);
} | true |
19e4e0c33d8d9d63fdca38ba8234ccf5e6cda44b | PHP | VivekVish/Veda-Project-API | /htdocs/resources/imagesByUsername.php | UTF-8 | 513 | 2.609375 | 3 | [] | no_license | <?php
require_once("classes/resources/Image.php");
require_once("classes/resources/User.php");
switch (strtolower($this->request->getMethod()))
{
case 'get': //only case, probably
$uriArr = explode("/",trim($this->request->getUri(),"/"));//extract username from second part of URI
$username = $uriArr[... | true |
8fc3413b30b2177e3b0178fe5308e14da44e6836 | PHP | Mrrobers0n/Tiny-MVC | /lib/Mvc/Loader.php | UTF-8 | 11,319 | 3.015625 | 3 | [] | no_license | <?php
require_once('Controller/Controller.php');
require_once('View/View.php');
require_once('Model/Model.php');
class Loader {
/**
* Handles everything from the controller to model to view
* Checks if everything is right
* Try's to call the controller action
* Call necessary methods
* Renders the view
*... | true |
136abf07567dc755c519a35f683eee3f8fabcdbc | PHP | chrisemerson/adventOfCode | /2015-PHP-TDD/spec/Day9/ShortestTripSpec.php | UTF-8 | 1,040 | 3.0625 | 3 | [] | no_license | <?php
namespace spec\AdventOfCode\Day9;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
class ShortestTripSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType('AdventOfCode\Day9\ShortestTrip');
}
function it_calculates_the_shortest_distance_between_2_places(... | true |
35b56bdb28602726d56746ddcf9e6f4ca01ac6b2 | PHP | TechniekCollegeRotterdam/kt3examentraining1 | /App/Controllers/Install.php | UTF-8 | 4,419 | 2.53125 | 3 | [] | no_license | <?php
namespace App\Controllers;
use App\Config;
use App\Database;
use App\Form;
use App\Lang;
use App\Renderer;
use App\Router;
use App\Session;
use App\Validator;
use App\Entities\Repositories\Menu as MenuRepo;
use App\Entities\Repositories\User as UserRepo;
class Install extends BaseController
{
/**
* @v... | true |
b6e0abfaea3323cba094f88eca80b3a10f0e247f | PHP | successmarket/oroinc-platform | /src/Oro/Bundle/SyncBundle/Authentication/Origin/OriginRegistry.php | UTF-8 | 823 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace Oro\Bundle\SyncBundle\Authentication\Origin;
use Gos\Bundle\WebSocketBundle\Server\App\Registry\OriginRegistry as BaseOriginRegistry;
/**
* Extends the origin registry to be able to use dynamically origins together with origins defined in the config.
*/
class OriginRegistry extends BaseOriginRegist... | true |
ca6d27e529b3df672e25d627ef70097ef5cbaa25 | PHP | nafism05/toko-camera-backend | /admin/update-supplier.php | UTF-8 | 4,257 | 2.65625 | 3 | [] | no_license | <?php include('cek-login.php'); ?>
<?php include('header.php'); ?>
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Edit Supplier</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
<!-- <h3>Edit Data Siswa</h3> -->
<?php
//proses mengambil data ke database untuk ditampilkan di form edit ber... | true |
5ad8359ff601afb6d7538c3dec265b55455a6938 | PHP | jasonb8293/fox-api | /app/API/Transformers/ClaimStatusTransformer.php | UTF-8 | 813 | 2.671875 | 3 | [] | no_license | <?php
namespace App\API\Transformers;
use App\ClaimStatus;
use League\Fractal\TransformerAbstract;
class ClaimStatusTransformer extends TransformerAbstract {
protected $availableIncludes = [
'claims',
'updates',
];
public function transform(ClaimStatus $claimStatus)
{
$template = [
'id' => (int) $clai... | true |
9723a24ab4d5e521369ef30030ae00149b18e498 | PHP | HidakaRintaro/BarterAgain | /func/func_db.php | UTF-8 | 6,837 | 3.21875 | 3 | [] | no_license | <?php
/**
* DB接続
*
* DBへの接続情報取得
*
* @return object DBの接続情報
*/
function get_connect() {
$link = mysqli_connect(HOST, USER_ID, PASS, DB_NAME);
mysqli_set_charset($link, 'utf8');
mysqli_set_charset($link, 'utf8');
return $link;
}
/**
* DB切断
*
* DBを切断する
*
* @param object $link... | true |
b4ec083be929d3e199b45f49d88a55d8f4f55f4d | PHP | Zigman13/xtubephp7 | /classes/Zend/Search/Lucene/Document/Html.php | UTF-8 | 6,822 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | <?php
require_once 'Zend/Search/Lucene/Document.php';
class Zend_Search_Lucene_Document_Html extends Zend_Search_Lucene_Document
{
private $_links = array();
private $_headerLinks = array();
private $_doc;
private static $_excludeNoFollowLinks = false;
private function __construct($data, $is... | true |
d782ee8eab9a2235fce4ce2c9c89c79e8c31fc97 | PHP | johngerome/scmandsmsystem | /protected/models/member_model.php | UTF-8 | 1,693 | 2.609375 | 3 | [] | no_license | <?php
if(!defined('BASEPATH')) exit('No direct script access allowed');
/**
*
*/
class Member_model extends CI_Model
{
public function __construct()
{
//$this->load->database();
$this->tbl_group = $this->db->dbprefix('group');
}
/**
* Save New Member Data
*
*/
public function saveData()
{
$tem... | true |
fa1e8952f9ec41e16add96dd275f304228159f86 | PHP | aziz417/registration-form | /app/Models/Subject.php | UTF-8 | 1,394 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Str;
/**
* @method static create(array $all)
* @method static where(string $string, $subject_name)
*/
class Subject extends Model
{
protected $fillable = [
'class_id',
... | true |
973310dad714f670c9e68e78778c9d8d5718ce4b | PHP | ovierevaldi/UnityWebRequestMySQL | /htdocs/PHP/CheckUserLogin.php | UTF-8 | 651 | 2.78125 | 3 | [] | no_license | <?php
# Include connection file to connect the databases
require 'MySQL_ConnectionFile.php';
$username = $_POST["usernamePOST"];
$password = $_POST["passwordPOST"];
$sql = "SELECT Password FROM users WHERE Username = '".$username."'";
$result = mysqli_query($conn, $sql);
if ($result)
{
if (mysqli_num_row... | true |
f07aa1bfab113f7617e80226e4bd69b9fe92411d | PHP | LeeDawson/CIscaffold | /src/Console/Commands/YafCommands/Common/ModulesCommand.php | UTF-8 | 2,385 | 2.53125 | 3 | [] | no_license | <?php
namespace OutSource\Console\Commands\YafCommands\Common;
use OutSource\Console\Commands\BaseCommand;
use OutSource\Console\Common\CommandData;
use OutSource\Console\Common\GeneratorConfig;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Compo... | true |
e8869b1b7eed4b2c17a83af55f457ca20cfe6719 | PHP | lowrencium/ReminderWS | /Application/Action/ContactAction.php | UTF-8 | 8,337 | 2.65625 | 3 | [] | no_license | <?php
class ContactAction implements IAction
{
public static function RegisterAction($server)
{
if($server instanceof SoapServer)
{
$server->addFunction("AjouterContact");
$server->addFunction("RecupererContacts");
$server->addFunction("SupprimerContact");
... | true |
ddf3d0183b52c761839e263519119336fdebb206 | PHP | CarlosDavidGarciaBendahan/SAI | /SAI/app/Http/Requests/OficinaRequest.php | UTF-8 | 928 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class OficinaRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get th... | true |
07dcc8bc10ce89885bbcf1cb1820b7725f044915 | PHP | lorena628/codeup-exercises | /if_and_or.php | UTF-8 | 978 | 3.8125 | 4 | [] | no_license | <?php
$x = 0;
$y = 5;
$z = 10;
// TODO:
if ($x<$y && $y<$z) {
echo "0 < 5 < 10 \n";
}
// If $x < $y < $z then echo "{$x} < {$y} < {$z}\n";
// TODO:
if(0<$x || $x<$z){
echo "0 is less than 0 or 0 is less than 10\n";
}
// If 0 is less than $x OR $x is less than 10
// then echo the result as a sentence "0 is less t... | true |
6b7f5431cf0c145beb884fcea7797ffe86e699b3 | PHP | shemi/laradmin | /src/Data/Schema.php | UTF-8 | 2,491 | 2.75 | 3 | [
"MIT"
] | permissive | <?php
namespace Shemi\Laradmin\Data;
use Illuminate\Contracts\Filesystem\Filesystem;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
class Schema extends Collection
{
/**
* @var Filesystem
*/
protected static $filesystem;
const BASE_DIR = "laradmin";
publ... | true |
77ecc4fb9f246e9a046b373cd1291984cf2114a2 | PHP | apexJCL/Notbook | /app/viewer/Viewer.php | UTF-8 | 3,984 | 2.59375 | 3 | [] | no_license | <?php
require_once PATH . 'controller/Controller.php';
class Viewer extends Controller
{
public function __construct()
{
parent::__construct('viewer');
if(isset($_POST['request'])){
$this->POSTHandler();
}
$this->showNote();
}
private function showNote()... | true |
029437875f0248656178a63aaba7d593039b338b | PHP | nadoneves/farma | /function/consultVenda.php | UTF-8 | 3,891 | 2.59375 | 3 | [] | no_license | <?php
include "../class/Call.class.php";
$codBarras = $_GET['codBarras'];
$codVenda = $_GET['codVenda'];
if($_GET['qtd'] == null)
$qtdVenda = 0;
else
$qtdVenda = $_GET['qtd'];
# Seleciona o produto através do Código de Barras
$query = "SELECT p.*, e.precoUnidade, es.qtd FROM produto p
INNER JOIN entrada_... | true |
a49d92796ae2e7ad72838b4ad8a701355e90ccba | PHP | JeffRisberg/PHP01 | /order_edit.php | UTF-8 | 1,501 | 2.8125 | 3 | [] | no_license | <!--/**
* Created by PhpStorm.
* User: Brandon
* Date: 10/14/2014
* Time: 3:40 PM
*/-->
<html>
<body>
<h2>Please Modify your Order:</h2>
<?php
$user = "developer";
$password = "123456";
$host = "localhost";
$db_name = "php01";
$db_connection = mysqli_connect($host, $user, $password, $db_name);
$order_id = $_RE... | true |
2e99035cd67ddbb1263dc3ce6b43f7afe3a765fe | PHP | PhoebeNBCC/Bitter | /fetchTweet.php | UTF-8 | 6,346 | 2.6875 | 3 | [] | no_license | <?php
date_default_timezone_set('America/Halifax');
//insert a tweet into the database
include("connect.php");
session_start();
include "Tweet.php";
$output = '';
$id = $_SESSION['SESS_MEMBER_ID'];
$json_out = fetchTweet($id);
echo $json_out;
function fetchTweet($id) { //$id is SESSION ID
$t = new Tweet();
glo... | true |
866d0b0bcfaac1dcb5e72a4d33af652590245a0c | PHP | Osch-1/web-development- | /lw3/removeExtraBlanks.php | UTF-8 | 198 | 2.546875 | 3 | [] | no_license | <?php
header("Content-Type: text/plain");
if (isset($_GET["text"])) {
$_GET["text"] = trim($_GET["text"]);
$_GET["text"] = preg_replace("/\s+/", " ", $_GET["text"]);
echo $_GET["text"];
} | true |
1129904ad571a48226d514bfc490daee0e6bc961 | PHP | MartineHooptOpBeter/website | /src/utilities.class.php | UTF-8 | 1,452 | 2.84375 | 3 | [
"MIT"
] | permissive | <?php
@@HEADER@@
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
require_once 'vendor/autoload.php';
class Utilities {
public static function formatShortDate($datetime, $locale) {
$fmt_date = new IntlDateFormatter($locale, IntlDateFo... | true |
de61f3f4451aa6238bc2e63bd3d72dcda150c749 | PHP | rvndrupal/MASTER_LARAVEL_2019 | /TODO_PHP/CURSOPHP/PHP7-0902-FechasGateDate/PHP7-0902-FechasGateDate.php | UTF-8 | 674 | 3.171875 | 3 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<title>Fechas Getdate()</title>
<meta charset="utf-8">
</head>
<body>
<?php
$meses = array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre");
$dias[] = "Domingo";
$dias[] = "Lunes";
$dias[] = "Martes";
$dias[] = "Miércoles";... | true |
78f2bb8175601f7f7103eb9a9cbef6c5bec7edb1 | PHP | Corviz/router | /src/Middleware.php | UTF-8 | 208 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace Corviz\Router;
use Closure;
abstract class Middleware
{
/**
* @param Closure $next
*
* @return mixed
*/
public abstract function handle(Closure $next): mixed;
}
| true |
f4a307a3c70e274d050ac56dcecfabfa7664564f | PHP | benjaminhansen/workday-wsdl | /src/StructType/Secondary_Termination_DataType.php | UTF-8 | 4,568 | 2.6875 | 3 | [] | no_license | <?php
namespace WorkdayWsdl\\StructType;
use \WsdlToPhp\PackageBase\AbstractStructBase;
/**
* This class stands for Secondary_Termination_DataType StructType
* Meta information extracted from the WSDL
* - documentation: The secondary reasons for the worker's most recent termination.
* @subpackage Structs
*/
cla... | true |
6794ba80b3643f5a0b58ffee31dd47dc6e6b1a17 | PHP | cleverad/collection | /src/Operation/Only.php | UTF-8 | 705 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace drupol\collection\Operation;
/**
* Class Only.
*/
final class Only extends Operation
{
/**
* {@inheritdoc}
*/
public function on(iterable $collection)
{
[$keys] = $this->parameters;
return static function () use ($keys, $collection): \... | true |
34ed56c25ca4cac54f7ffb7212349b39c7c129aa | PHP | shavenking/shortest-path | /index.php | UTF-8 | 2,713 | 2.9375 | 3 | [] | no_license | <?php
require_once __DIR__ . '/Map.php';
$map = new Map([
[0,0,0,0,0,0,0,0,0,0],
[0,1,0,0,0,0,0,2,0,0],
[0,0,1,0,0,0,0,0,0,0],
[0,0,0,1,0,0,0,0,0,0],
[0,0,0,0,1,0,0,0,0,0],
[0,0,0,0,0,1,0,0,0,0],
[0,0,0,0,0,0,1,0,0,0],
[0,3,0,0,0,0,0,1,0,0],
[0,0,0,0,0,0,0,0,1,0],
[0,0,0,0,0,0,... | true |
37ff76d42684ceca28ac731f2ae613d129d2e4d8 | PHP | jonathanadhitama/toy-robot | /src/Runner.php | UTF-8 | 3,568 | 3.671875 | 4 | [] | no_license | <?php
require_once "Robot.php";
require_once "CommandFileNotFoundException.php";
/**
* Class Runner
*
* Main application class that reads and executes the received robot commands from the provided command text file
*/
class Runner {
/**
* @var array
*/
protected $argv;
/**
* Runner cons... | true |
36845996d85eeecf47ec0e1b82c8bb2e8a8289d8 | PHP | mdasadask/laravel-yajra-edit-delete-ajax | /app/Http/Controllers/YajraController.php | UTF-8 | 2,168 | 2.546875 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use App\Models\User;
use Illuminate\Http\Request;
use DataTables;
use Illuminate\Support\Facades\Validator;
class YajraController extends Controller
{
public function index()
{
return view('welcome');
}
public function getData(Request $request)
{
... | true |
14f337c6f1d3065d5f71be2f408df1c624a6948b | PHP | danielahofmann/bookster | /app/Http/Controllers/UserController.php | UTF-8 | 3,833 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: danielahofmann
* Date: 14.07.18
* Time: 14:54
*/
namespace App\Http\Controllers;
use App\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
class UserController extends Controller
{
public function __construct()... | true |
a31ba702823c59c60fdbd0204bf6a048883161f8 | PHP | Fabian-Fynn/tandem | /matches.php | UTF-8 | 1,725 | 2.65625 | 3 | [] | no_license | <?php
/*TANDEM is a second semester project (MultiMediaProjekt 1) of the course Multimedia Technology at University of Applied Sciences Salzburg
Author: Fabian Hoffmann
Course of Study: Multimedia Technology
At: University of Applied Sciences Salzburg
fhoffmann.mmt-b2013@fh-salzburg.ac.at
"Icons made by Icons8, Free... | true |
8d022fa186e12e4271701815c1190358dd472bad | PHP | dungdt88/aggiehack | /web_app/src/Csg/DataBundle/Service/AbstractImporter.php | UTF-8 | 2,662 | 2.984375 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | <?php
namespace Csg\DataBundle\Service;
use Doctrine\DBAL\Connection;
use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException;
/**
* Class AbstractImporter
* @package Csg\DataBundle\Service
*/
abstract class AbstractImporter
{
/**
* @var \Doctrine\DBAL\Connection
*/
... | true |
8d637e76d2a73edc7db31f1f777bfe04433e3a55 | PHP | Sandeep309/blogWebsite | /process/editBlogProcess.php | UTF-8 | 797 | 2.71875 | 3 | [] | no_license | <?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
extract($_POST);
$conect = @mysqli_connect('localhost', 'root', '', 'blogsdb')
or die('Error<br><h2>' . mysqli_connect_error() . "</h2>");
if ($conect) {
if (isset($_GET['id'])) {
$id = $_GET['id'];
$sql = "UPDATE bl... | true |
f944d702f995b453c25c6d57b78e8dbed4d76443 | PHP | kevinlondon/appfuel | /lib/Appfuel/Framework/Db/Request/RequestInterface.php | UTF-8 | 886 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | <?php
/**
* Appfuel
* PHP 5.3+ object oriented MVC framework supporting domain driven design.
*
* @package Appfuel
* @author Robert Scott-Buccleuch <rsb.code@gmail.com.com>
* @copyright 2009-2010 Robert Scott-Buccleuch <rsb.code@gmail.com>
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
na... | true |
a6a26cd6e7292c6e42b7e67fe1268156764d24d3 | PHP | nuvalis/moluz | /app/lib/MUser/MUser.php | UTF-8 | 10,105 | 2.953125 | 3 | [] | no_license | <?php
class MUser
{
private $password;
private $username;
private $hashCost = "12";
private $db;
private $MFlash;
function __construct()
{
$this->db = new MDatabase();
$this->flash = new MFlash();
$this->createTable();
}
... | true |
6c0777e045f0997a89a930e8fbdc3f9923be9fe1 | PHP | luofei2011/base-rest-ci | /app/libraries/Sms.php | UTF-8 | 4,197 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace CodeIgniter\libraries;
use Exception;
use CodeIgniter\libraries\Redis;
use CodeIgniter\libraries\Utils;
use AlibabaCloud\Client\AlibabaCloud;
use AlibabaCloud\Client\Exception\ClientException;
use AlibabaCloud\Client\Exception\ServerException;
class Sms {
const EXPIRE_SEC = 600; // 过期时间间隔
const... | true |
dd62a1084b2be1210688fd17976f403401e488cf | PHP | dennau/Jam | /Jam/Db/Model.php | UTF-8 | 2,983 | 2.6875 | 3 | [] | no_license | <?php
namespace Jam\Db;
class Model {
protected $primaryName;
protected $fields = [];
public function __construct($data = []) {
if (!empty($data)) {
foreach ($data as $field => $value) {
if (array_key_exists($field, $this->fields)) {
$this->fields[$field] = $value;
}
... | true |
82067d8288655c3979473798853f2ebe36411ac0 | PHP | MarkusLocalHost/WebShop-PHP-Laravel | /app/Observers/CommentObserver.php | UTF-8 | 1,083 | 2.8125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Observers;
use App\Models\BlogComment;
use Carbon\Carbon;
class CommentObserver
{
/**
* Обработка ПЕРЕД созданием записи
*
* @param BlogComment $comment
*/
public function creating(BlogComment $comment)
{
$this->setPublishedAt($comment);
}
/**
... | true |
868da6329d5c64a6adf1247e0181c280578aeb4f | PHP | zyanam/YifengDatiChoujiang | /funcs.php | UTF-8 | 405 | 3.078125 | 3 | [] | no_license | <?php
//通过页面返回json格式的超时信息,方便ajax程序处理。
function sessionOverTime()
{
$arr = array("overtime" => true);
echo json_encode($arr);
die();
}
function makeRand($begin=0,$end=20,$limit=5){
$rand_array=range($begin,$end);
shuffle($rand_array);//调用现成的数组随机排列函数
return array_slice($rand_array,0,$limit);//截取前... | true |
fbe36868b67413b31fc6eb48127823fbb659d44f | PHP | wellington1993/epl | /src/Epl/Command/PrintCommand.php | UTF-8 | 1,862 | 3.3125 | 3 | [
"MIT"
] | permissive | <?php
namespace Epl\Command;
use Epl\CommandAbstract as Command;
/**
* Use this command to print the contents of the image buffer
*
* @author Dmitry Petrov <dmitry.petrov@opensoftdev.ru>
*/
class PrintCommand extends Command
{
/**
* @var string
*/
const NAME = 'P';
/**
* Number of lab... | true |
4752288bd4ef1a0079d259c5ad11f57083ffc89b | PHP | msoftn1/exchange-api | /app/Services/Cbr.php | UTF-8 | 5,233 | 2.96875 | 3 | [] | no_license | <?php
namespace App\Services;
use App\Currency;
use App\Exceptions\LoadDataException;
use App\Rate;
use GuzzleHttp\Client;
use Symfony\Component\DomCrawler\Crawler;
/**
* Сервис получения курсов валют.
*/
class Cbr
{
/**
* Получить курс валюты.
*
* @param string $currency
* @param string ... | true |
8a64d9c856868e53733007d0c7c2a67d4e5a7df2 | PHP | mkvtvseries/automatic_uploading_posts | /App/Model/PostModel.php | UTF-8 | 885 | 3.140625 | 3 | [] | no_license | <?php
namespace App\Model;
class PostModel
{
/**
* @var
*/
private $postName;
/**
* @var
*/
private $postSlug;
/**
* @var
*/
private $postContent;
/**
* ArticleModel constructor.
* @param $postName
* @param $postSlug
* @param $postCont... | true |
09b495c69f9c183924294a438b6913f3ee5ae180 | PHP | alifrahmadian/love-2-grow | /database/migrations/2021_06_25_172525_create_medicine_stocks_table.php | UTF-8 | 877 | 2.515625 | 3 | [] | no_license | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateMedicineStocksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('medicine... | true |
bc35db45d809320421967b35fbc0b0f21b06acd8 | PHP | beloofficial/rakhmet-task1 | /app/Transforms/AttributeGoodTransformer.php | UTF-8 | 397 | 2.5625 | 3 | [] | no_license | <?php
namespace App\Transforms;
use App\AttributeGood;
class AttributeGoodTransformer extends \League\Fractal\TransformerAbstract
{
/**
* Turn this item object into a generic array
*
* @param AttributeGood $attributeGood
* @return array
*/
public function transform(AttributeGood $attribute... | true |
ef7c79a4f0e4ff22e241f0fe56a2e513285d4545 | PHP | kdrdmr/dhl-sdk-api-express | /src/Webservice/Soap/TypeMapper/TrackingRequestMapper.php | UTF-8 | 2,219 | 2.5625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
/**
* See LICENSE.md for license details.
*/
namespace Dhl\Express\Webservice\Soap\TypeMapper;
use Dhl\Express\Api\Data\TrackingRequestInterface;
use Dhl\Express\Webservice\Soap\Type\SoapTrackingRequest;
use Dhl\Express\Webservice\Soap\Type\Tracking\AWBNumberCollection;
use Dhl\Express\Webservice\Soap\Type\Tra... | true |
a8ae969f77e995cd5c57d1cf17e1fa5c1804573e | PHP | 123ahmad/UAS-FP | /app/Http/Controllers/PdfController.php | UTF-8 | 1,328 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Codedge\Fpdf\Fpdf\Fpdf;
use App\Models\Post;
use PDF;
class PdfController extends Controller
{
public function pdf(Fpdf $pdf)
{
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 18);
$pdf->MultiCell(0, 10, 'Aplikasi... | true |
322c3fc5585c3d7f51e3fae5c736b9866e92dd2a | PHP | bitmartexchange/bitmart-php-sdk-api | /src/BitMart/Futures/APIContractMarket.php | UTF-8 | 3,263 | 2.875 | 3 | [
"MIT"
] | permissive | <?php
namespace BitMart\Futures;
use BitMart\Auth;
use BitMart\CloudConst;
use BitMart\Lib\CloudClient;
use BitMart\Lib\CloudConfig;
class APIContractMarket
{
static $cloudClient;
public function __construct(CloudConfig $cloudConfig)
{
self::$cloudClient = new CloudClient($cloudConfig);
}
... | true |
0b19303a0decc090a2b005183cbbf99bde3d4b98 | PHP | Partypapa/Facebook-App | /library/Fancrank/Rest/Route.php | UTF-8 | 1,088 | 2.53125 | 3 | [] | no_license | <?php
/**
* Same as Zend_Rest_Route but does the reverse in terms of checking for restful controllers
* basically, it excludes, instead of includes controllers to be restful.
* used in Bootstra.php:
*
* $restRoute = new Zend_Rest_Route($frontController, array(), array('api' => array('home', 'docs')));
*
*/
class... | true |
d6e5c8776d7acda53a2d216896aafef54bf02f35 | PHP | bifuteki/phwittr-on-xoops | /Sabel/sabel/cache/File.php | UTF-8 | 1,461 | 2.921875 | 3 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | <?php
/**
* cache to file
*
* @category Cache
* @package org.sabel.cache
* @author Ebine Yutaka <ebine.yutaka@sabel.jp>
* @copyright 2004-2008 Mori Reo <mori.reo@sabel.jp>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
*/
class Sabel_Cache_File implements Sabel_Cache_In... | true |
259b5a49b6ace6f232cc5382b27eb26933170a22 | PHP | Morebec/ValueObjects | /src/DateTime/Time/TimeAmount.php | UTF-8 | 2,014 | 3.5625 | 4 | [
"MIT"
] | permissive | <?php
namespace Morebec\ValueObjects\DateTime\Time;
use Morebec\ValueObjects\ValueObjectInterface;
/**
* TimeAmount 1 year, 2 days, 1 week etc.
*/
class TimeAmount implements ValueObjectInterface
{
/** @var float */
private $amount;
/** @var TimeUnit */
private $unit;
public function __constr... | true |