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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
eb4707609fbb12cd23ba88f852f5130f9255fc72 | PHP | ko1eda/e-commerce-api | /tests/Unit/CategoryTest.php | UTF-8 | 1,811 | 2.53125 | 3 | [] | no_license | <?php
namespace Tests\Unit;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
use App\Models\Category;
use App\Models\Product;
class CategoryTest extends TestCase
{
public function test_it_has_many_children()
{
// Given we have a paren... | true |
d1ff51fd29757392d027fb64c235021cc4e76856 | PHP | lukasboc/parazei | /vendor/lesstif/php-jira-rest-client/src/Issue/RemoteIssueLinkObject.php | UTF-8 | 632 | 2.640625 | 3 | [
"MIT",
"BSD-3-Clause",
"Unlicense",
"Apache-2.0",
"OSL-3.0"
] | permissive | <?php
namespace JiraRestApi\Issue;
class RemoteIssueLinkObject
{
/** @var string */
public $url;
/** @var string */
public $title;
/** @var string|null */
public $summary;
/** @var array|null */
public $icon;
/**
* @var array|null
*
* ```json
* "status": {
... | true |
eaf26f4756bdd872f2b8995d0c60679733d256c5 | PHP | rrahool/Atomic_Project_Final_B57_Team_Error_Point | /views/Team_Error_Point/Gender/view.php | UTF-8 | 3,240 | 2.515625 | 3 | [] | no_license | <?php
require_once "../../../vendor/autoload.php";
use App\Gender\Gender;
use App\Message\Message;
use App\Utility\Utility;
if(!isset($_GET['id'])) {
Message::message("You can't visit view.php without id (ex: view.php?id=23)");
Utility::redirect("index.php");
}
$obj = ne... | true |
5b74de1640d41815b20430d1220e117fb480918b | PHP | elektronika/eldsjal | /application/models/tagmodel.php | UTF-8 | 1,668 | 2.765625 | 3 | [] | no_license | <?php
class TagModel extends AutoModel {
public function get_all($for_images = TRUE) {
if( ! $for_images)
$this->db->where('image_only !=', 1);
return $this->db->select('artid AS id, artname AS tag, slug')->get('artlist')->result();
}
public function get_all_assoc($for_images = TRUE) {
$tags = $this->get_... | true |
34c3cbf2d215e5842d5595e888036c823641c3e7 | PHP | carono/docdoc-api | /src/Response.php | UTF-8 | 1,331 | 2.921875 | 3 | [] | no_license | <?php
namespace carono\docdoc;
/**
* Class Response
*
* @package carono\docdoc
*/
class Response extends \ArrayObject
{
protected $client;
protected $method;
public function toArray()
{
$result = [];
foreach ($this as $key => $value) {
$result[$key] = $value;
... | true |
142c1adfc242ba974bed117a0e5b4f906a041fd8 | PHP | d1rk/flour | /views/helpers/grid.php | UTF-8 | 2,113 | 2.890625 | 3 | [] | no_license | <?php
/**
* GridHelper.
*
* Provides access to blueprint specific functions
*
* PHP versions 5
*
* @category Helpers
* @author Dirk Bruensicke <dirk@bruensicke.com>
* @copyright 2009 Dirk Bruensicke
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @link http://b... | true |
06bcd3fa656032c3b1fa2ad5e9ea936ae10e869d | PHP | jbcfrance/cpk-framework | /controller/loginController.php | UTF-8 | 2,679 | 2.625 | 3 | [] | no_license | <?php
/**
* Controller de la page login
*
* @author Jean-Baptiste CIEPKA
* @license https://opensource.org/licenses/MIT MIT
* @package CPKFramework
* @subpackage Controller
*/
use CPK\Framework\Controller;
/**
* Controller de la page login
*
* @author Jean-Baptiste CIEPKA
* ... | true |
cf27328ab00f475e6e4bb2ed24d92fe508b30218 | PHP | deljdlx/dashboard | /source/class/Component/Card/Accordion/Accordion.php | UTF-8 | 1,303 | 2.546875 | 3 | [] | no_license | <?php
namespace Elbiniou\Dashboard\Component\Card;
use Elbiniou\Dashboard\Component;
class Accordion extends Component
{
protected static $globalCSS = array();
protected $css = array();
protected static $globalJavascripts = array();
protected $javascript = array();
protected $variableCollecti... | true |
136111e20d59d76b78d8ac207d69ba12501ccdf7 | PHP | jobsonrp/EditorOnlineDOC | /editor/open_docs.php | UTF-8 | 952 | 2.5625 | 3 | [] | no_license | <?php
if(isset($_POST['enter'])){
$entrar = $_POST['enter'];
}elseif(isset($_POST['enterNew'])){
$entrar = $entrarNew;
}elseif(isset($_POST['enterSave'])){
$entrar = $entrarSave;
}elseif(isset($_POST['enterUp'])){
$entrar = $entrarUp;
}
if (isset($entrar)) {
if(isset($_POST['nomeArquivo'])){
$nome=$_POST... | true |
e01eccb19db68f8e27103c893f6ad9b08c481926 | PHP | haoranya/CLASS- | /App/Home/Controller/LeaveController.class.php | UTF-8 | 3,916 | 2.578125 | 3 | [] | no_license | <?php
namespace Home\Controller;
//HomeController 在Core文件夹下,并且命名空间 Core
use \Core\HomeController;
class LeaveController extends HomeController{
/*
* getAllTypes() 方法
* 主要的作用查询所有的分类
*/
function doList(){
// var_dump($_SESSION);
$StudentModel = new \Model\StudentModel;
$rules = $StudentMo... | true |
227e1b4440cc2cd19989dc8ed2715290957e1ab1 | PHP | rowanhill/xssfinder | /xssfinder-php-executor/test/XssFinder/TestSite/Page/HomePage.php | UTF-8 | 987 | 2.609375 | 3 | [] | no_license | <?php
namespace XssFinder\TestSite\Page;
/**
* @page
*/
class HomePage
{
/** @var \WebDriver */
private $_driver;
public function __construct(\WebDriver $driver)
{
$this->_driver = $driver;
}
/**
* @submitAction
* @return HomePage
*/
public function unsafeSubmit(... | true |
7dfad79e44d78ad8f682152a816a754990425286 | PHP | KazukiYokoyama/PHP_Study | /module/Model.php | UTF-8 | 529 | 2.921875 | 3 | [] | no_license | <?php
include ('../module/DBConnect.php');
class Model{
protected $url = []; // リクエストされたURL
protected $page_data = []; // ページで使用する情報
protected $page;
function __construct(array $url) {
$this->url = $url;
}
/**
* Modelの処理を記述する
*/
public function Action(){}
/**
* ページで使用する情報を返す
*/
final publ... | true |
54d69940c48ea960c64cd60c3985dc359eb86b80 | PHP | SomaDarmayasa/Teknologi-Web | /aritmatika.php | UTF-8 | 1,343 | 2.921875 | 3 | [] | no_license | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<tittle>
<h1>Deret Aritmatika</h1>
</tittle>
<link rel="stylesheet" href="./PHP/stylephp.css">
</head>
<body>
<form action=" " method="POST"><br>
... | true |
5a88cfd85cb8b78840143888525089f19b593cd3 | PHP | spiffyjr/spiffy-framework | /src/Action/DispatchExceptionAction.php | UTF-8 | 1,048 | 2.625 | 3 | [] | no_license | <?php
namespace Spiffy\Framework\Action;
use Spiffy\Framework\View\ViewManager;
use Spiffy\View\ViewModel;
class DispatchExceptionAction extends AbstractAction
{
/** @var \Spiffy\Framework\View\ViewManager */
private $vm;
/**
* @param \Spiffy\Framework\View\ViewManager $vm
*/
public funct... | true |
f1988e9aed3fc89363ae6a29906e896a41b44045 | PHP | jeonsh1991/my_PHP | /trait/Milk.php | UTF-8 | 436 | 3.203125 | 3 | [] | no_license | <?php
require_once("DateTool.php");
class Milk {
use DateTool;
public $theDate;
public $limitDate;
function __construct() {
$now = new DateTime();
$this -> theDate = $this ->ymdString($now);
$this-> limitDate = $this -> addYmdString($now, 10);
}
}
$my... | true |
2f1289e3e71ee1b7f5a44fb4f04a390b2d6abf22 | PHP | dylnio/abparser | /src/Dyln/Alibaba/ImageParser.php | UTF-8 | 700 | 2.703125 | 3 | [] | no_license | <?php
namespace Dyln\Alibaba;
use DOMElement;
use phpQuery;
class ImageParser
{
public function parseAlibabaExpressImages($url)
{
return $this->parseAlibabaExpressImagesFromContent(file_get_contents($url));
}
public function parseAlibabaExpressImagesFromContent($content)
{
phpQuer... | true |
0c71ac427d09d855ff4879af617fa09b39ed89c1 | PHP | Gaiden92/Projet-Back-end | /assets/dao/NoteDao.php | UTF-8 | 1,366 | 2.90625 | 3 | [] | no_license | <?php
class NoteDao {
public static function retrieveCommentsByMembre(PDO $pdo, $pseudo): array
{
$query = "SELECT c.* FROM commentaire c, membre m
WHERE 1=1 AND c.membre_id = m.id_membre
AND m.pseudo = :pseudo
ORDER BY c.date_enregistrement desc";
$req = $p... | true |
4633c2c5725538346c43fcf6d6cd138d03dc5614 | PHP | msredhotero/newdashboard | /redimencionarimagenes.php | UTF-8 | 1,360 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
$pathPlanilla = 'arbitros';
$filesPlanilla = array_diff(scandir($pathPlanilla), array('.', '..'));
include 'includes/ImageResize.php';
include 'includes/ImageResizeException.php';
/*
$image = new \Gumlet\ImageResize($pathPlanilla.'/'.$value);
$image->scale(50);
$image->save($pathPlanilla.'/'.$v... | true |
95c2551c41d4bce701ce46d8a069c1642f6ebabf | PHP | arkcommunityfund/ARKCommerce | /arkcommerce/arkcommercewoo.php | UTF-8 | 13,584 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php
/*
ARKCommerce
Copyright (C) 2017-2018 Milan Semen
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, p... | true |
d2e6a867b17dab0b5ac656d160a1b404286926e2 | PHP | noamarchante/University_Management | /ET3/Controller/EDIFICIO_Controller.php | UTF-8 | 7,507 | 2.875 | 3 | [] | no_license | <?php
/*
Archivo php
Nombre: EDIFICIO_Controller.php
Autor: Noa López Marchante
Fecha de creación: 06/10/2019
Función: Script que recibe datos introducidos por el usuario a través de una vista (asociada a una acción). Según la acción a realizar seleccionada (ADD, EDIT, SHOWCURRENT, DELETE, DEFAULT), el controla... | true |
c68176068281b7902ff75af06a474720d53a61c7 | PHP | db0company/db0.fr | /include/tools.php | UTF-8 | 1,036 | 2.78125 | 3 | [] | no_license | <?php
function getGravatar($email, $size) {
return "http://www.gravatar.com/avatar/"
.md5(strtolower(trim($email)))
."?d=mm&s=".intval($size);
}
function getRandomPic($kind) {
$path = 'img/'.$kind.'/';
$pic = array_diff(scandir($path), array('.', '..'));
shuffle($pic);
return $path.$pic[0];
}
funct... | true |
b45360f382c34ad0ac5d7ca0d85051480bb8e9d1 | PHP | pepsipepsi/website001 | /model/articles/markdownLoader.php | UTF-8 | 456 | 2.546875 | 3 | [] | no_license | <?php
include("lib/php/Parsedown.php");
include("lib/php/ParsedownExtra.php");
function loadMarkdown($articleName){
$Extra = new ParsedownExtra();
echo '<div class="markdown_container">';
$myFilePath = __FILE__;
$myFilePath = str_replace(basename(__FILE__), "", $myFilePath) .$articleName .'/markdown/' ... | true |
cdac497ce4dfdcb468d752d291fe917f4bb7ef10 | PHP | mikyvato/webexpedientes | /protected/models/Usuarios.php | UTF-8 | 2,433 | 2.53125 | 3 | [] | no_license | <?php
class Usuarios extends CActiveRecord
{
public function tableName()
{
return 'usuarios';
}
public function rules()
{
return array(
array('nombre, apellido, username, password, oficinas_id_oficina', 'required'),
array('oficinas_id_oficina', 'numerical', 'integerOnly'=>true),
array('nombre', 'len... | true |
42d031ee0c4e12ebce5d2320914d90d94123cc7d | PHP | ChavdarSpasov/PHPPractice | /PHP OOP Basics/date Modifier/dateModifier.php | UTF-8 | 297 | 2.875 | 3 | [] | no_license | <?php
include_once "DateModifier.php";
$dateOne = trim(fgets(STDIN));
$dateTwo = trim(fgets(STDIN));
$dateOne= str_replace(" ","-",$dateOne);
$dateTwo = str_replace(' ','-',$dateTwo);
$dateModifier= new DateModifier($dateOne,$dateTwo);
print $dateModifier->DateDiff();
| true |
0862a459f3b5f8b8d8d22b8e596e63f3f7de0046 | PHP | rsmakota/grabber | /src/Grabber/Bundle/GrabBundle/Grabber/BaseGrabber.php | UTF-8 | 1,496 | 2.828125 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | <?php
/**
* @author Rodion Smakota <rsmakota@gmail.com>
* @copyright 2015 Grabber LLC
*/
namespace Grabber\Bundle\GrabBundle\Grabber;
use Grabber\Bundle\GrabBundle\Entity\Country;
use Grabber\Bundle\GrabBundle\Service\CategoryManager;
use Grabber\Bundle\GrabBundle\Service\LocalityManager;
use GuzzleHttp\Client;... | true |
cb0996615f4a24b541216f62ee15613a06b40c31 | PHP | github-hewei/PHP_Code | /PinYinV2/pinyin.php | UTF-8 | 1,049 | 2.6875 | 3 | [] | no_license | <?php
require_once('pinyin_table.php');
function get_pinyin_array($string)
{
global $pinyin_table;
$flow = array();
$luoma = array();
for ($i=0;$i<strlen($string);$i++)
{
if (ord($string[$i]) >= 0x81 and ord($string[$i]) <= 0xfe)
{
$h = ord($string[$i]);
if (isset($string[$i+1]))
{
... | true |
87a43388569fb5d45d24943b43dbb09f6482123d | PHP | turkmvc/gdrive-cms-php | /controller/admin_controller.php | UTF-8 | 8,700 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
/**
* Admin_Controller class
*/
class Admin_Controller extends Base_Controller
{
private $_recur_counter = array();
private $_recur_limit = 3;
private $_client;
private $_client_oauth;
private $_token;
public function __construct($matches)
{
// start our admin session
... | true |
0dd318783d0761d6f8a6c6d21ea6cfc54108ba35 | PHP | juliocpiro/angularjs | /jqgrid/server.php | UTF-8 | 1,467 | 2.75 | 3 | [] | no_license | <?php
$dbhost="localhost";
$dbuser="root";
$dbpassword="";
$database="escuela";
$page = $_REQUEST['page']; // get the requested page
$limit = $_REQUEST['rows']; // get how many rows we want to have into the grid
$sidx = $_REQUEST['sidx']; // get index row - i.e. user click to sort
$sord = $_REQUEST['sord']... | true |
7b072438015e07984f0bb14a465c8d00104e5d1e | PHP | YOURLS/YOURLS | /includes/functions.php | UTF-8 | 42,212 | 2.890625 | 3 | [
"LicenseRef-scancode-proprietary-license",
"MIT"
] | permissive | <?php
/*
* YOURLS general functions
*
*/
/**
* Make an optimized regexp pattern from a string of characters
*
* @param string $string
* @return string
*/
function yourls_make_regexp_pattern( $string ) {
// Simple benchmarks show that regexp with smarter sequences (0-9, a-z, A-Z...) are not faster or slower... | true |
87269de7ff18c2e50ef83ca08785f7e98930ea62 | PHP | rrps/Database-Course | /Project/Part3/region/regions.php | UTF-8 | 2,692 | 2.890625 | 3 | [] | no_license | <?php
session_start();
?>
<html>
<head>
<meta charset="utf-8">
<title>SIBD Project</title>
<link rel="stylesheet" type="text/css" href="../css/style.css">
<link rel="stylesheet" type="text/css" href="../css/table_style.css">
</head>
<body>
<?php include '../header.php';?>
<?php... | true |
a62e0898936b90bef7bcdaa2a330391da2c548fa | PHP | Maxzilla60/DenMax-Webproject | /Mini/myproject/test/Repository/PDOLocationRepositoryTest.php | UTF-8 | 2,761 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: dennis
* Date: 06.11.17
* Time: 14:48
*/
use Mini\Repository\PDOLocationRepository;
use PHPUnit\Framework\TestCase;
use Mini\Model\Location;
class PDOLocationRepositoryTest extends TestCase
{
public function setUp()
{
$this->mockUserDAO = $this->getMockBui... | true |
5faa95d11aaea5581bec026297cd555f69f7a930 | PHP | huzhiming12/itil | /home/model/DepartTree.class.php | UTF-8 | 3,086 | 2.625 | 3 | [] | no_license | <?php
class Tree
{
//将数组转换成树形数组
public function getTree($data, $pId)
{
$tree = '';
foreach ($data as $k => $v) {
if ($v['parent_id'] == $pId) { //父亲找到儿子
$v['parent_id'] = $this->getTree($data, $v['id']);
$tree[] = $v;
... | true |
54ca7e2173d561210a1b878386984181aa83b373 | PHP | jcorpus/Farmacia | /Modulo_almacen/model/model_marca.php | UTF-8 | 3,233 | 2.71875 | 3 | [] | no_license | <?php
class Marca {
private $db;
public function __construct(){
require_once('../core/models/model_conexion.php');
$this->db = new Conexion();
}
function modificar_marca($id_marca2,$id_usuario2,$nmarca2,$estado_marca2,$fecha_registro){
$sql = "UPDATE alm_marca SET alm_marca.usu_id = '$id_usuario2',... | true |
5ad60893775d0705b1e0d000bfa90cf8c659f95e | PHP | Sachindu1/PHP_BIT_FinalProject | /classes/qusestionqire_class.php | UTF-8 | 3,818 | 2.71875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: Sachindu
* Date: 6/27/2018
* Time: 6:38 PM
*/
include_once 'baseModal_class.php';
/**
* Class questionnaire
* create a qestionire based on year
* an indicator whcih questionaire tempalte has used in a perticular year
*
*/
class questionnaire extend... | true |
5ebed9fe0084d6377186129f6abfd751a6a877f9 | PHP | Darlinkster/php-dynamodb-odm | /ut/BasicGameInfo.php | UTF-8 | 1,105 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: minhao
* Date: 23/11/2017
* Time: 4:42 PM
*/
namespace Darlinkster\Mlib\ODM\Dynamodb\Ut;
use Darlinkster\Mlib\ODM\Dynamodb\Annotations\Field;
use Darlinkster\Mlib\ODM\Dynamodb\Annotations\Item;
/**
* Class BasicGameInfo
*
* @package Darlinkster\Mlib\ODM\Dynamodb\Ut
*... | true |
3a763003a0b97916b3f93dc901c83bc12a68f819 | PHP | e-karahan/PHP-Education | /3.conditions/4.alternativeSyntax.php | UTF-8 | 607 | 3.765625 | 4 | [
"Apache-2.0"
] | permissive | <?php
$a = 5;
/*
Switch ($a) {
case 5:
echo "5";
break;
case 6:
echo "6";
break;
default:
echo "Unknown";
break;
}
Switch($a):
case 5:
echo "5";
break;
case 6:
echo "6";
break;
default:
echo "Unknown!";
break;
endswitc... | true |
abe8965aab428f6e8e53b32bbf537a698723863e | PHP | Speicher210/Reflection | /src/Annotation/AnnotationDefinition.php | UTF-8 | 1,111 | 3.046875 | 3 | [
"MIT"
] | permissive | <?php
namespace Wingu\OctopusCore\Reflection\Annotation;
/**
* Class that holds the raw output of the annotation parser for one annotation.
*/
class AnnotationDefinition
{
/**
* The tag name of the annotation.
*
* @var string
*/
protected $tag;
/**
* The description text for t... | true |
e38c8d57c2374109fa02ab8745f4093ebb9550db | PHP | Ammenas/php | /week 5/functions.php | UTF-8 | 289 | 3.171875 | 3 | [] | no_license | <?php
function groet($naam)
{
echo "hallo " . $naam . ", wat zie je er goed uit vandaag!";
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Functies</title>
</head>
<body>
<h3>Functies</h3>
<?php
groet("Francesco");
?>
</body>
</html> | true |
7099de8a13b3d57b012c1763b222b392b860b5a3 | PHP | Crov/developer-test | /task1/UserRegistry/tests/Feature/UserListingTest.php | UTF-8 | 2,281 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
namespace Tests\Feature;
use App\Repositories\Interfaces\UserRepositoryInterface;
use App\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Artisan;
use Tests\TestCase;
class UserListingTest e... | true |
2e03b55f6e9f0c453cf512815a7cc81a49643e57 | PHP | LukaPatarcic/education-projects | /OOP PHP/Walkadog-MVC/core/Validator.php | UTF-8 | 103 | 2.546875 | 3 | [] | no_license | <?php
namespace App\core;
interface Validator
{
public function isValid(string $value): bool;
} | true |
9f85fddab32050e590636a83fdf328f7f04c4723 | PHP | nishangsys/Jungle | /superadmin/change_pwd.php | UTF-8 | 4,889 | 2.625 | 3 | [] | no_license | <?php
$_POST = array_map("ucwords", $_POST);
include '../includes/dbc.php';
?>
<link rel="stylesheet" media="screen" href="../css/left-fluid.css">
<link rel="stylesheet" href="../js/boostrap.css">
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<?php
@session... | true |
995ad9c744a07e624a3b5839dbe5e208ecbfb9e5 | PHP | estebanmatias92/RestGalleries | /src/RestGalleries/Auth/OhmyAuth/OhmyAuth.php | UTF-8 | 761 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php namespace RestGalleries\Auth\OhmyAuth;
use RestGalleries\Auth\Auth;
use ohmy\Auth as OAuth;
/**
* Specific auth client made on Ohmy-Auth Client.
*/
class OhmyAuth extends Auth
{
/**
* Creates auth instance variable to use it.
*/
public function __construct()
{
$this->auth = new O... | true |
0400f8fd60c4ffab87c1d03480e38cfad20e6446 | PHP | pedroresende/CMS | /src/Xvolutions/AdminBundle/Tests/Helpers/PaginationTest.php | UTF-8 | 2,123 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace Xvolutions\AdminBundle\Tests\Helpers;
use Xvolutions\AdminBundle\Helpers\Pagination;
/**
* Description of PaginationTest
*
* @author Pedro Resende <pedroresende@mail.resende.biz>
*/
class PaginationTest extends \PHPUnit_Framework_TestCase
{
public function testDisplayPagination1()
{
... | true |
d3a96b1c405b6dfdf68a734e712ad1cc4f317c88 | PHP | aymenhamada/BSQ | /bsq.php | UTF-8 | 2,603 | 3.390625 | 3 | [] | no_license | <?php
if(isset($argv[1])){
$check = fopen($argv[1].'.txt', 'r') || die("Unable to open file!");
$path = $argv[1].'.txt';
readPlate($path);
}else{
echo "Veuillez mettre un chemin de fichier texte en deuxième paramètre\n";
}
function readPlate($path){
$plan = fopen($path, 'r');
while(! feof($pla... | true |
07bc4c040142034a8819e2c762c4af91380ca050 | PHP | platreth/app_ticket | /src/Entity/Ticket.php | UTF-8 | 1,588 | 2.734375 | 3 | [] | no_license | <?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\TicketRepository")
*/
class Ticket
{
// ...
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="users")
* @ORM\JoinColumn(nullable=true)
*/
private $user;
pu... | true |
aadc840d2e56ed23effd6d3d40f3379ed288b71f | PHP | nialltiernan/GameHub | /database/factories/AffiliateLinkFactory.php | UTF-8 | 2,657 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace Database\Factories;
use App\Enums\AffiliateLinkTypes;
use App\Enums\BannerShapes;
use App\Models\Affiliate;
use App\Models\AffiliateLink;
use Illuminate\Database\Eloquent\Factories\Factory;
class AffiliateLinkFactory extends Factory
{
private const IMAGE_PROPERTIES = [
['width' => 300, 'h... | true |
fbd9b860ca4f473b3cded626eabe1d9a7854f989 | PHP | AgnieszkaM2/Bookshop-website | /cartclass1.php | UTF-8 | 1,714 | 2.65625 | 3 | [] | no_license | <?php
error_reporting(E_ALL ^ E_NOTICE);
include("config.php");
session_start();
class Cart {
protected $cart_contents = array();
public function insert($item = array()){
$message="";
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', '');
... | true |
89321f3a1856f092e76b77c798bb77454f072db8 | PHP | KeeperJerry/L-Shop-remade | /app/Services/Caching/ClearsCache.php | UTF-8 | 730 | 2.515625 | 3 | [] | no_license | <?php
declare(strict_types = 1);
namespace app\Services\Caching;
use Doctrine\ORM\EntityManagerInterface;
trait ClearsCache
{
protected function clearResultCache(): void
{
$cache = $this->getEntityManager()->getConfiguration()->getResultCacheImpl();
if ($cache !== null && method_exists($cache... | true |
3f7db49fa2ea6695c918d542ba6ccfd49484e5aa | PHP | k-razovicka/profile | /app/Controllers/ApplicationController.php | UTF-8 | 1,807 | 2.59375 | 3 | [] | no_license | <?php
namespace App\Controllers;
use App\Core\View;
use App\Core\Database;
use App\Model\User;
class ApplicationController
{
public function show()
{
View::show('index.html');
}
public function store()
{
User::add();
header('Location: /');
}
public function updat... | true |
3b1d13d299e67dde8baa123293b2b4e87dee51b4 | PHP | narbelys/fototea | /beta/fototea/models/PaymentManager.php | UTF-8 | 2,333 | 2.703125 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: jose
* Date: 6/15/14
* Time: 10:21 PM
*/
namespace Fototea\Models;
use Fototea\Models\Order;
use Fototea\Models\Payment;
use Fototea\Models\PuntoPagos;
class PaymentManager {
const GATEWAY_TRANSACTION_STATUS_OK = 1;
const GATEWAY_TRANSACTION_STATUS_ERROR = 0;
... | true |
199a65fac9dff58b863519385ea130f7f03ff8af | PHP | Hu-Bin-bit/php-1 | /index.php | UTF-8 | 3,924 | 2.65625 | 3 | [] | no_license | <?php
include('db.php');
$sql = "SELECT * FROM msg ORDER BY id DESC";
$sth = $pdo->prepare($sql);
$sth->execute();
$rows = $sth->fetchALL();
// var_dump($rows);
?>
<?php
header('Content-type:text/html; charset=utf-8');
// 开启Session
session_start();
// 首先判断Cookie是否有记住了用户信息
if (isset($_COOKIE['username'])) {
# 若记住... | true |
57fa767f18bcc9da79d720fb83d98d119fdae78b | PHP | fracz/refactor-extractor | /results/versionpress--versionpress/e8b82a76aa54ebf5146151846131f10c429baa35/before/VersionPressChangeInfo.php | UTF-8 | 1,495 | 2.875 | 3 | [] | no_license | <?php
/**
* Class used for commit representing installation of VersionPress
*/
class VersionPressChangeInfo extends BaseChangeInfo {
const OBJECT_TYPE = "versionpress";
const ACTION = "install"; // there are no other actions handled by this change info yet
/**
* @return string
*/
public f... | true |
0590ff018c9d2f6b6abb071de3a23358368e0dc5 | PHP | kleitz/wp-experiensa | /src/Modules/Taxonomy.php | UTF-8 | 3,087 | 2.71875 | 3 | [] | no_license | <?php namespace Experiensa\Plugin\Modules;
use Experiensa\Plugin\Modules\Helpers;
class Taxonomy
{
/**
* Get all custom taxonomies from a post type name and exclude taxonomies on the list($excluded) param
* @param $post_type
* @param null $excluded
* @return array|null
*/
public stati... | true |
5f2b7469fdc22ec7e514de986fbf1b8d5e386043 | PHP | remolaz/12MinutesClasses | /PHP in 12 minutes/Index.php | UTF-8 | 884 | 3.890625 | 4 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
Hello World!
<!-- FIND the Video here: https://www.youtube.com/watch?v=ZdP0KM49IVk&list=PLlj0ik1QSBLBQh_ohwDjGuV2N5qMTc-9u&index=12&t=304s -->
<?php
// The user can't see the php code, but only the output
echo "Hello World";
$myVar = "This is my... | true |
f1fc9518e67ab5852e7e5e4de027ea5b85be1c20 | PHP | NasExt/Navigation | /src/NasExt/Navigation/Container/NavigationItem.php | UTF-8 | 1,987 | 2.9375 | 3 | [
"MIT"
] | permissive | <?php
/**
* This file is part of the NasExt extensions of Nette Framework
* Copyright (c) 2013 Dusan Hudak (http://dusan-hudak.com)
* For the full copyright and license information, please view
* the file license.txt that was distributed with this source code.
*/
namespace NasExt\Navigation\Container;
class Navi... | true |
d2c6fb257534d22121d445698c5282e02c0f9184 | PHP | jccuevas/ssaatt1920_seminarioHTML5 | /form.php | UTF-8 | 865 | 3.171875 | 3 | [] | no_license | <!DOCTYPE html>
<html lang="es" dir="ltr">
<head>
<meta charset="utf-8">
<title>Ejemplos seminario HTML5</title>
</head>
<body>
<?php
if ($_GET == null) {
echo "No hay parámetros por GET" . "<br>";
} else {
$valor = "";
... | true |
17ffb5a43486641b8472baed0ab4c3ee7fec40b6 | PHP | ian-patel/custom-cms | /app/Core/Model.php | UTF-8 | 1,161 | 3.078125 | 3 | [] | no_license | <?php
namespace App\Core;
use stdClass;
use Exception;
abstract class Model
{
/**
* Get all the records of the model
*/
public function get()
{
$db = new DB();
$result = $db->query("Select * from " . $this->getTableName());
return $this->collection($result);
}
... | true |
3020ef186f4c3de0ba99253a1a2b7034a83e2404 | PHP | jBernavaPrah/eloquent-fs | /src/Exception/CorruptFileException.php | UTF-8 | 1,333 | 2.9375 | 3 | [
"MIT"
] | permissive | <?php
namespace JBernavaPrah\EloquentFS\Exception;
class CorruptFileException extends \RuntimeException
{
/**
* Thrown when a chunk is not found for an expected index.
*
* @param integer $expectedIndex Expected index number
* @return self
*/
public static function missingChunk($expe... | true |
2428f52d85d38c32a831440e74ba3e99621b6f12 | PHP | CG420/example.com | /public/contact.php | UTF-8 | 3,007 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
//Usage
require '../bootstrap.php';
//checkSession();
require '../core/processContactForm.php';
//Declare namespaces
use About\Validation;
$valid = new About\Validation\Validate();
$args = [
'firstName'=>FILTER_SANITIZE_STRING,
'lastName'=>FILTER_SANITIZE_STRING,
'email'=>FILTER_SANITIZE_EMAIL,
'subject'=... | true |
deb3ffec18e415eecac5b5f4ce4b44976e06fcdf | PHP | isaak-sielleur/runtrack2 | /jour04/job03/index.php | UTF-8 | 518 | 2.859375 | 3 | [] | no_license | <?php
$i = 0;
foreach ($_POST as $key => $value)
{
if (isset($value))
{
$i = $i +1;
}
}
echo $i;
?>
<form name="mon-formulaire1" method="post">
<p>
<label for="prenom"> Votre prénom :<br /> </label>
<input type="text" name="prenom" />
</p>
<p>
<label for="nom">Votre nom :<br /... | true |
ab26e1cca8bd09f62ae33ea7a02d222be686c7f2 | PHP | SalFay/Student-Portal | /admin/attendance.php | UTF-8 | 7,427 | 2.703125 | 3 | [] | no_license | <?php require __DIR__ . '/header.php' ?>
<?php
$db = new Database();
if (!empty($_GET['action'])) {
$action = $_GET['action'];
if ($action === 'add') {
?>
<div class="panel panel-primary">
<div class="panel-heading">
<div class="panel-title">
Take ... | true |
69ab8e93327e9bb28c0052a3ffea8e833c8357b1 | PHP | camt-mmit/2020-01-954246-lab03-array-Mao-jia | /1.php | UTF-8 | 372 | 2.859375 | 3 | [] | no_license | <?php
/**
* ID:602110189
* Name: Mao Jia
* WeChat: Ga
*/
printf("input number of data:");
fscanf(STDIN,"%d",$size);
for ($i=1;$i<=$size;$i++){
printf ("input socore $i:");
fscanf(STDIN,"%f",$ar[$i]);
}
$total = array_sum($ar);
$num = count($ar);
$average = $total/$num;
prin... | true |
f3e4bda6ae621375c42528c9d0a9ae13f424f858 | PHP | carrel2/CaseStudies | /src/AppBundle/Entity/HotSpot.php | UTF-8 | 1,796 | 2.515625 | 3 | [] | no_license | <?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity
* @ORM\Table(name="HotSpots")
*/
class HotSpot
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Many... | true |
34c52692923c809927a885590c0abbdc30a1b6a2 | PHP | Panathes/AvatarForum | /application/api/src/Infrastructure/Router.php | UTF-8 | 1,241 | 2.765625 | 3 | [] | no_license | <?php
namespace App\Infrastructure;
class Router
{
/**
* @var array|Route[]
*/
protected array $routes = [];
public function __construct()
{
$this->routes[] = new Route('/', 'GET', 'status');
$this->routes[] = new Route('/users/(\d*)/avatar', 'GET', 'getAvatar');
$th... | true |
5bc0e2ae28058c14069d8a7a40ef8be3ab6f3c92 | PHP | smsapi/smsapi-mautic | /Core/Connection.php | UTF-8 | 1,048 | 2.59375 | 3 | [] | no_license | <?php
namespace MauticPlugin\MauticSmsapiBundle\Core;
use Smsapi\Client\Curl\SmsapiHttpClient;
use MauticPlugin\MauticSmsapiBundle\MauticSmsapiConst;
use RuntimeException;
use Smsapi\Client\Service\SmsapiComService;
use Smsapi\Client\Service\SmsapiPlService;
class Connection
{
private $integrationHelper;
pub... | true |
cf0ff842bb71386ddb4c422fd068499ab5bf83ba | PHP | charlesmade/zor | /src/Logger.php | UTF-8 | 905 | 2.609375 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: yf
* Date: 2018/8/14
* Time: 下午6:15
*/
namespace Zor;
use Lib\Component\Singleton;
use Zor\Console\TcpService;
class Logger extends \Lib\Trace\Logger
{
use Singleton;
function log(string $str, $category = 'default')
{
parent::log($str, $category); /... | true |
5d51fc6c59b45664ef7f4d135c7765ade9cb79ce | PHP | liorchamla/bouchery-csv2json | /src/Application.php | UTF-8 | 8,372 | 3.046875 | 3 | [] | no_license | <?php
namespace App;
use App\CommandLine\CommandLineHelper;
use App\Csv\CsvFileHelper;
use App\Exception\AggregationException;
use App\Exception\CsvInvalidValueException;
use App\Exception\FileNotFoundException;
use App\Exception\FormatterNotFoundException;
use App\Formatter\FormatterInterface;
use App\Validation\Exc... | true |
6016f6a1e86c8cad2d81a0b0794d20d58ce5d403 | PHP | OlivierHe/blog_ecrivain | /Action/InsertArticleAction.php | UTF-8 | 1,220 | 2.75 | 3 | [] | no_license | <?php
/**
* * User: Olivier Herzog
* Date: 12/08/2017
* Time: 13:17
*/
namespace Action;
use App\Router;
use App\Settings;
use Domain\Database;
use Responder\InsertArticleResponder;
class InsertArticleAction
{
private $db;
private $responder;
private $request;
private $config;
public funct... | true |
ae4919403b06097cdab1272aa77be43892117d9d | PHP | baburajambalam/subjecttrainer | /pJSON/SQLite3/question/unused/question-variable-get copy.php | UTF-8 | 2,080 | 2.59375 | 3 | [] | no_license | <?php
//__DIR__ document root
include_once __DIR__ .'/../../db-helper.php';
$sqlStatment = "";
try
{
$post_data = file_get_contents('php://input'); // Get Raw Posted Data
$json = json_decode($post_data, true); // Decode it
$qid = GetNumberFromArray($json, "qid");
$qvid = GetNumb... | true |
a38a2c172a284b4be1adfac83245f288bb8c697a | PHP | Zarganwar/LetsBet | /src/Storage/File.php | UTF-8 | 876 | 3.03125 | 3 | [] | no_license | <?php declare(strict_types = 1);
namespace Zarganwar\LetsBet\Storage;
use Zarganwar\LetsBet\Values\Ticket;
class File implements IStorage
{
/** @var string */
private $path;
public function __construct(string $path)
{
$this->path = $path;
}
public function save(Ticket $ticket): bool
{
self::prepareDir(... | true |
b094c97b632fe91dd194cb6232803dd6ddfa0407 | PHP | arthur32810/blog_ecrivain | /model/UserEntity.php | UTF-8 | 859 | 2.90625 | 3 | [] | no_license | <?php
Class UserEntity
{
protected $id;
protected $pseudo;
protected $password;
protected $role;
public function getId()
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
return $this;
}
public function ge... | true |
35ec27c15df5d993a4d955f82ef24577e38469fc | PHP | barons/pageCMStwee | /htdocs/application/modules/admin/models/Producten.php | UTF-8 | 1,084 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | <?php
class Admin_Model_Producten extends Zend_Db_Table_Abstract
{
protected $_name = 'producten';
protected $_primary = 'id';
/**
* Add product
* @param string $titel
* @param string $omschrijving
* @param float $prijs
* @return object $product;
*/
public function... | true |
1c9fad11cb516f7f5ae7bfa1d4e8bd486b804d7f | PHP | alirezarahmani/sheypoor | /backend/domain/model/aggregate/motorbike.php | UTF-8 | 1,837 | 2.890625 | 3 | [
"MIT"
] | permissive | <?php
namespace Backend\domain\model\aggregate;
use Illuminate\Database\Eloquent\Model;
use ValueObjects\Money\Currency;
use ValueObjects\Money\CurrencyCode;
use ValueObjects\Money\Money;
use ValueObjects\Number\Integer;
class motorbike extends Model implements \Backend\domain\model\aggregate\aggregateroot
{
... | true |
95d37ebacd33d9e55bce86f8db61547940d0cbb3 | PHP | Jrodicio/LaComandaNoHeroku | /app/controllers/ComandaController.php | UTF-8 | 4,534 | 2.734375 | 3 | [] | no_license | <?php
require_once './models/Comanda.php';
require_once './interfaces/IApiUsable.php';
class ComandaController extends Comanda implements IApiUsable
{
public function CargarUno($request, $response, $args)
{
$parametros = $request->getParsedBody();
if(isset($parametros['nombreCliente'], $parame... | true |
c2b09dc80d16de8bd1dd80b52dd92d942f4d8d13 | PHP | steevanb/symfony-form-options-builder | /src/OptionsBuilder/UrlOptionsBuilder.php | UTF-8 | 1,142 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | <?php
declare(strict_types=1);
namespace Steevanb\SymfonyFormOptionsBuilder\OptionsBuilder;
use Steevanb\SymfonyFormOptionsBuilder\{
OptionsBuilder\Behavior\AbstractOptionsBuilder,
OptionsBuilder\Behavior\OptionsBuilderInterface
};
use Symfony\Component\Form\Extension\Core\Type\UrlType;
class UrlOptionsBui... | true |
5e26a899df26d94eedf009ff919ac47538152427 | PHP | qq330496248/sky | /ccs/protected/dao/cgaaDAO.php | UTF-8 | 14,265 | 2.734375 | 3 | [] | no_license | <?php
/**
* @desc 客户表操作类
* @author huyan
* @date 2015-11-12
*/
class cgaaDAO extends BaseDAO{
/**
* @desc 对象实例重用
* @author huyan
* @date 2015-11-12
* @param string $className
* @return cgaaDAO
*/
public static function getInstance($className = __CLASS__){
return parent::createInstance($className);... | true |
09569a4d8ced08362b52fc5cca0d283a5bb125d2 | PHP | dialloscott/Event | /index.php | UTF-8 | 329 | 2.578125 | 3 | [] | no_license | <?php
use Ramata\Event\Emitter;
require "vendor/autoload.php";
$emiter = Emitter::getInstance();
$comment = 'lorem';
$emiter->on('comment.created',function($comment){
echo $comment;
},1);
$emiter->on('comment.created',function($comment){
echo PHP_EOL.$comment.'lamiddd';
},5000);
$emiter->emit('comment.created',$c... | true |
43520bca408c2390a0be6e18fc5c95df1c2c12b8 | PHP | paschke/jackalope | /src/Jackalope/Observation/EventJournal.php | UTF-8 | 10,644 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace Jackalope\Observation;
use PHPCR\Observation\EventJournalInterface,
PHPCR\Observation\EventInterface,
PHPCR\RepositoryException,
PHPCR\SessionInterface;
use Jackalope\FactoryInterface,
Jackalope\Observation\Filter\EventFilterChain,
Jackalope\Observation\Filter\EventFilterInterface... | true |
efa5ec354db656084242713d9b696a82279d4dfc | PHP | sruj/course_wzorce_projektowe_sanders | /TRENING/1_MetodaFabrykujaca/Creator.php | UTF-8 | 202 | 2.78125 | 3 | [] | no_license | <?php
abstract class Creator {
abstract function factoryMethod();
public function startFactory() {
$product = $this->factoryMethod();
return $product;
}
}
| true |
2701a22e2db02ca925b40a3d770b9391ff4430bc | PHP | mecontrola-zz/mecontrola-lib | /index.php | UTF-8 | 522 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
include 'library/autoloader.php';
use mecontrola\entities\CPF as CPF;
use mecontrola\entities\CNPJ as CNPJ;
use mecontrola\entities\inscricaoestadual\Bahia as Bahia;
$obj = new CPF();
echo('CPF: 681.113.352-02 => ' . ($obj->isValid('681.113.352-02') ? 'Sim' : 'Não') . '<br>');
$obj = new CNPJ();
echo('CNPJ: 86... | true |
df9c54f87fb06aa851aed38f39b629d77ee0c337 | PHP | dechtum/slim-api | /mcs/Libs/Date.php | UTF-8 | 5,495 | 2.859375 | 3 | [] | no_license | <?PHP
class Date
{
public function date_datediff( $str_interval, $dt_menor, $dt_maior, $relative=false){
if( is_string( $dt_menor)) $dt_menor = date_create( $dt_menor);
if( is_string( $dt_maior)) $dt_maior = date_create( $dt_maior);
//date_add($dt_menor,date... | true |
8fd12e4af2a94673f9a93a01b84dd9b1abc73d38 | PHP | YetiForceCompany/UpdatePackages | /YetiForce CRM 3.x.x/3.2.0_to_3.3.0/updates/files/modules/OSSDocumentControl/helpers/ConditionsTest.php | UTF-8 | 10,203 | 2.75 | 3 | [] | no_license | <?php
/* +***********************************************************************************************************************************
* The contents of this file are subject to the YetiForce Public License Version 1.1 (the "License"); you may not use this file except
* in compliance with the License.
* Softw... | true |
230c0a31954d2df72a4cf3e7004983447d5c4fd7 | PHP | emmanuel-cabassot/boutique | /Models/Model.php | UTF-8 | 4,425 | 3.1875 | 3 | [] | permissive | <?php
namespace App\Models;
use App\Core\Db;
class Model extends Db
{
// Table de la base de données
protected $table;
// Instance de Db
private $db;
public function findAll()
{
$query = $this->requete('SELECT * FROM ' . $this->table);
return $query->fetchAll();
}
... | true |
1164ce182691ebda11da2bf4b0f809946f111320 | PHP | github-timall/clean-architecture | /src/UseCase/UseCaseInterface.php | UTF-8 | 626 | 2.84375 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types = 1);
namespace Damianopetrungaro\CleanArchitecture\UseCase;
use Damianopetrungaro\CleanArchitecture\UseCase\Request\RequestInterface;
use Damianopetrungaro\CleanArchitecture\UseCase\Response\ResponseInterface;
interface UseCaseInterface
{
/**
* Method to call for initialize the ... | true |
a17457a4a0ec64c38b8c58c57df3a6d9464e8a89 | PHP | Donsilor/gdzb | /addons/Warehouse/common/forms/WarehouseBillBForm.php | UTF-8 | 991 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace addons\Warehouse\common\forms;
use addons\Warehouse\common\models\WarehouseBill;
use common\helpers\ArrayHelper;
use common\helpers\StringHelper;
/**
* 退货返厂单 Form
*
*/
class WarehouseBillBForm extends WarehouseBill
{
public $goods_ids;
/**
* {@inheritdoc}
*/
public function ... | true |
47528e875b46767c532ddcd397baa6c3f482e727 | PHP | celie56/si_206_group | /old_form/script.php | UTF-8 | 1,119 | 3.109375 | 3 | [] | no_license | <?php
// this script will run once the user has submitted data to our form
$fp = fopen("userinput.txt", "a"); // file to write all data to
$message = "Email confirmation:\n"; // This will be the message to email users
foreach($_POST as $key => $value){
if($key == "interests"){ // Parse interest list
foreac... | true |
4ab42b9eaae8fc734c3315168d9ec31a977a314e | PHP | GenCommBrasil/magento1-genpay | /lib/Rakuten/Connector/src/Helpers/Document.php | UTF-8 | 1,909 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | <?php
/**
************************************************************************
* Copyright [2018] [RakutenConnector]
*
* 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
*
* h... | true |
bc78a917bf5bf7c2714da5c3cf6ecb383bf16326 | PHP | Dage92/Projet-IN507 | /Projet IN507_David GOOMDAN_Amir HAMMAD/root/db_connect.php | UTF-8 | 715 | 2.765625 | 3 | [] | no_license | <?php
// Les quatre variables pour se connecter à la base de donnée
$host = "localhost";
$username = "user";
$password = "user";
$database = "user";
//~ CREATE USER 'Users'@'localhost' identified by 'User1234&';
//~ CREATE USER 'Employes'@'localhost' identified by 'Employe1&';
//~ CREATE USER 'Admin'@'local... | true |
027f4592d10eba988c7d8e9c8c7d073e22fa44a4 | PHP | rachdi/sitemap-plugin | /src/Provider/IndexUrlProvider.php | UTF-8 | 1,487 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace SitemapPlugin\Provider;
use SitemapPlugin\Factory\SitemapIndexUrlFactoryInterface;
use Symfony\Component\Routing\RouterInterface;
final class IndexUrlProvider implements IndexUrlProviderInterface
{
/** @var array */
private $providers = [];
/** @var RouterInterf... | true |
0fb82194ef585f208ae0d88abff5bc8420712a60 | PHP | WesselEngels/BeerShop_63389 | /GameWorld/bier.php | UTF-8 | 1,228 | 2.625 | 3 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Pils Shop</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<?php include 'inc/header.php'; ?>
<div id="container">
<?php include 'inc/menu.php';?>
<?php
require("inc/conne... | true |
0f68137d55c74eafe1e540c8c87b94e1fde98853 | PHP | lingtalfi/Bat | /Util/FastImageSize/Type/TypeJp2.php | UTF-8 | 1,689 | 2.6875 | 3 | [] | no_license | <?php
namespace Ling\Bat\Util\FastImageSize\Type;
use Ling\Bat\Util\FastImageSize\FastImageSizeHelper;
/**
* Original project by https://github.com/marc1706/fast-image-size.
* I modified this utility for my own preferences, but the core is the same.
* All credits go to the author of the repository.
*
* The Typ... | true |
f820dccba8e0dd0a237e8bbec72ac7c4377db3a6 | PHP | clitustran1207/Laravel-GreenMarket | /app/Charts/SampleChart.php | UTF-8 | 543 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Charts;
use ConsoleTVs\Charts\Classes\Chartjs\Chart;
class SampleChart extends Chart
{
/**
* Initializes the chart.
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->labels(['One', 'Two', 'Three', 'Four', 'Five'])
... | true |
af5f1ec62d576a12467f6ebde68984f8bfd0ce85 | PHP | KNIGHTTH0R/TravelsAppWeb | /objects/Comment.php | UTF-8 | 640 | 3.234375 | 3 | [] | no_license | <?php
namespace travels\objects;
class Comment{
private $commentID;
private $driverUserName;
private $passUserName;
private $comment;
private $score;
public function __construct($commentID, $driverUserName, $passUserName, $comment, $score){
$this->commentID = $commentID;
$this->driverUserName = $... | true |
8fe2d6054f9ac80970568d281b3892f285e0125d | PHP | tdorkaa/Legacy | /src/Game.php | UTF-8 | 5,177 | 3.296875 | 3 | [] | no_license | <?php
namespace Game;
class Game {
private $players;
private $currentPlayerIndex = 0;
/**
* @var Player
*/
private $currentPlayer;
/**
* @var CategoryCollection
*/
private $categories;
private $options;
const DEFAULT_CONFIG = [
'CAN_LEAVE_PENALTY_BOX' => f... | true |
01ff089bc4e2c76a4f98e0614a6c32ce3ddb07ca | PHP | chiquita-pl/training-repo | /test/unit/PictureResizerTest.php | UTF-8 | 795 | 2.53125 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: wikto
* Date: 02/06/2018
* Time: 14:42
*/
use App\Picture;
use App\PictureResizer;
class PictureResizerTest extends \PHPUnit\Framework\TestCase
{
/**
* @var PictureResizer
*/
protected $pictureResizer;
public function setUp()
{
$this->pi... | true |
6d2857af499798fd7f9ca2c1b3f8e124fc516d72 | PHP | AlexandrePhilibertCPNV/traffic-light | /controllers/index.php | UTF-8 | 514 | 2.828125 | 3 | [] | no_license | <?php
require_once 'classes/TrafficLight.php';
$traffic_light = new TrafficLight();
if (isset($_SESSION['last_state'])) {
$traffic_light->last_state = $_SESSION['last_state'];
}
if (isset($_GET['next'])) {
$_SESSION['last_state'] = $traffic_light->set_next_state();
} else if (isset($_GET['pause'])) {
$_... | true |
bf12eeb4f014d7d8ea5a4d7e039abb8948498581 | PHP | hkgokul/CarbIndia | /mailer.php | UTF-8 | 1,264 | 2.59375 | 3 | [] | no_license | <?php
$to = 'hkgokul@gmail.com';
$subject = "Appointment Notification";
$feildContent='';
foreach ($_POST as $key => $value) {
$feildContent=$feildContent.'<tr><td>'.htmlspecialchars($key).'</td><td>'.htmlspecialchars($value).'</td></tr>';
};
echo $to;
$htmlContent = '<!DOCTYPE html>
<html>
<head... | true |
b9795433ede1afdaa67d29066e6495625650408f | PHP | DechkoTonev/zodiaka | /SoftUni-Blog/controllers/PostsController.php | UTF-8 | 6,600 | 2.828125 | 3 | [] | no_license | <?php
class PostsController extends BaseController
{
function onInit()
{
$this->authorize();
}
function index() {
$this->authorize();
$this->authorizeAdministration();
$this->posts = $this->model->getAll();
}
function userCreate() {
$thi... | true |
66ffa03d4af610e41c2388c60d429721ca0591ec | PHP | bicycle-coalition-of-maine/BPSETracker | /controllers/InstInfoController.php | UTF-8 | 6,716 | 2.765625 | 3 | [] | permissive | <?php
namespace app\controllers;
use Yii;
use app\models\InstructorInfo;
use app\models\Person;
use yii\data\ActiveDataProvider;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
/**
* InstInfoController implements the CRUD actions for InstructorInfo model.
*/
class InstInfoCo... | true |
a37aab6843f459f17fa0e95100476f2c2a9bd1e4 | PHP | rob-1774/loja_test_1-1 | /php/db_connection.php | UTF-8 | 318 | 2.65625 | 3 | [] | no_license | <?php
// constante
$server = "localhost";
$username = "root";
$password = "";
$db = "DB_COMPANY";
// conexao com banco
$connection = mysqli_connect($server,$username,$password,$db);
mysqli_set_charset($connection, "utf8");
if(mysqli_connect_error()):
echo "Erro na conexão: ".mysqli_connect_error();
endif;
?>
| true |