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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1922fa29019b210636f7d8515fe80476a4c0637a | PHP | filonuse/b2bback | /app/Http/Resources/StoreResource.php | UTF-8 | 1,102 | 2.515625 | 3 | [] | no_license | <?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\Resource;
use Swagger\Annotations as SWG;
/**
* Class StoreResource
* @package App\Http\Resources
*
* @SWG\Definition(
* type="object",
* definition="StoreResource",
* @SWG\Property(property="id", type="integer"),
* @SWG\... | true |
e0a11441ccf91b4d116ca07f484212457202faff | PHP | iths-bananbyran/quiz-forger-plugin | /public/class-render-quiz.php | UTF-8 | 3,792 | 2.8125 | 3 | [] | no_license | <?php
class Render {
private static function get_questions($id) {
global $wpdb;
$table_name = $wpdb->prefix . 'quizforgequestions';
$questions = $wpdb->get_results( "SELECT * FROM $table_name WHERE quiz_id=$id" );
return $questions;
}
private stat... | true |
38d2f6e9ba481664f21763dce2de5a5335c39f0a | PHP | getformwork/formwork | /formwork/src/Files/File.php | UTF-8 | 4,728 | 3.125 | 3 | [
"MIT"
] | permissive | <?php
namespace Formwork\Files;
use Exception;
use Formwork\Data\Contracts\Arrayable;
use Formwork\Utils\FileSystem;
use Formwork\Utils\MimeType;
use Formwork\Utils\Str;
class File implements Arrayable
{
/**
* File path
*/
protected string $path;
/**
* File name
*/
protected stri... | true |
8d8c30b6628af3e412ffaeeaed14819d3b81d467 | PHP | darshudarshu/ooops | /php/adressbook/utilityadress.php | UTF-8 | 2,488 | 3.203125 | 3 | [] | no_license | <?php
class UtilityAdd
{
//validating string data
public function stringData()
{
$name = readline();
if (preg_match("/[^A-Z]{1}[a-z]$/", $name) && !(preg_match('/[0-9]/', $name))) {
return ucfirst($name);
} else {
echo "invalid Name , Enter again\n";
... | true |
2d08c82a062887367abe8e9e36b6a9e69e69e89b | PHP | Jensen-kaz/Eshop | /controllers/CartController.php | UTF-8 | 5,498 | 2.5625 | 3 | [] | no_license | <?php
class CartController
{
public function actionAdd($id)
{
//Добавляем товар в корзину
Cart::addProduct($id);
//Возвращаем пользователя на страницу
$referrer = $_SERVER['HTTP_REFERER'];
header("Location: $referrer");
}
//Обработка асинхронного запроса
... | true |
8110f4769caa719d36cf438097571d76d61ba810 | PHP | miacelPereira/Pop-s-Soda-Drink | /cms/model/DAO/usuarioCmsDao.php | UTF-8 | 3,912 | 2.96875 | 3 | [] | no_license | <?php
/*
Projeto: Padronizando CRUD em MVP; ORIENTADO A OBJETOS;
Criado por: Elimarp
Data Criação: 11/03/2019
Última modificação:
Conteúdo modificado:
Modificado por:
Objetivo: CRUD da tb_contatos
*/
class UsuarioCmsDao{
private $conn;
public function __construct(){
/... | true |
da7dad44107d467dc4057ff5b3123cab9bee5054 | PHP | mikeven/cocobeautylanding | /database/data-usuarios.php | UTF-8 | 9,343 | 2.765625 | 3 | [] | no_license | <?php
/* --------------------------------------------------------- */
/* Cupfsa Coins - Datos sobre usuarios */
/* --------------------------------------------------------- */
/* --------------------------------------------------------- */
function obtenerUsuarioPorId( $dbh, $id_u ){
// Devuelve el registr... | true |
e97ab258fe3e60cb157d738274fcdfc3d56d859e | PHP | LarissaMitL/rdfDemo | /HomeController.php | UTF-8 | 1,534 | 2.78125 | 3 | [] | no_license | <?php
class HomeController extends BaseController {
/*
|--------------------------------------------------------------------------
| Default Home Controller
|--------------------------------------------------------------------------
|
| You may wish to use controllers instead of, or in addition to, Closure
| b... | true |
323792003dff856e3bfd7e3d3aab92b9be5ae21e | PHP | Bobylove/php-units | /Rover.php | UTF-8 | 1,466 | 3.453125 | 3 | [] | no_license | <?php
class Rover {
public $x=0;
public $y=0;
public $direction;
public function __construct($x,$y,$dir){
$this->x = $x;
$this->y = $y;
$this->direction = $dir;
}
public function forward(){
if ($this->direction === "nord" ) {
return $this->y -= 1;
}
if ($this->direction === "sud") {
... | true |
153d5e5f1f3418c5e0d96abbb52f12a42cbf63a5 | PHP | Airshown/hackathon | /class/modele/visit.modele.class.php | UTF-8 | 961 | 2.90625 | 3 | [] | no_license | <?php
class visit extends bdd{
protected $id;
protected $user;
protected $hotel;
protected $date_debut;
protected $date_fin;
public function __construct(){
parent::__construct();
}
public function setFromBdd($var = []){
foreach($var as $key => $value){
$this->$key = $value;
}
}
public f... | true |
fa6e1678fd053ec5177b48f77e8b9d054140d0fd | PHP | p-gorecki/number-to-words | /src/Language/Polish/Dictionary/Currency.php | UTF-8 | 1,470 | 2.90625 | 3 | [] | no_license | <?php
namespace Kwn\NumberToWords\Language\Polish\Dictionary;
class Currency
{
private static $units = [
'PLN' => ['złoty', 'złote', 'złotych'],
'EUR' => ['euro', 'euro', 'euro'],
'GBP' => ['funt', 'funty', 'funtów'],
'USD' => ['dolar', 'dolary', 'dolarów'],
'CHF' => ['frank... | true |
8407292d138770b5f17396fdfc4c4111606df360 | PHP | arnapou/simplesite | /site/php/controller.php | UTF-8 | 1,186 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
/*
* This file is part of the Arnapou Simple Site package.
*
* (c) Arnaud Buathier <arnaud@arnapou.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Arnapou\SimpleSite\Core\Controller;
use S... | true |
61db2c3f790af91080a5219ad6739490eb75c180 | PHP | fxjung/vertretungsplan | /class_vpView.inc | UTF-8 | 9,801 | 3.046875 | 3 | [] | no_license | <?php
require_once("vertretungsplan/globals.inc");
define("VP_VIEW_MODE_TEACHER", 0);
define("VP_VIEW_MODE_PUPIL", 1);
class vpView {
/** @var vpParser */
var $oParser;
/** @var array of arrays of type vpStandIn */
var $ararSortedStandIns;
/** @var constant */
var $cMode;
/** @var string */
var... | true |
6217a0397fade2541f4fd8248e7dce46874e5078 | PHP | Andresmgd/novusPev-master | /novusPev/app/Http/Controllers/PeriodoController.php | UTF-8 | 2,650 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Periodo;
class PeriodoController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view('per... | true |
603ba7c4176521b5185b93150864e24c3c927410 | PHP | kyomo12/vPOS | /includes/functions.php | UTF-8 | 10,952 | 2.984375 | 3 | [
"MIT"
] | permissive | <?php
$errors = array();
/*--------------------------------------------------------------*/
/* Function for Remove escapes special
/* characters in a string for use in an SQL statement
/*--------------------------------------------------------------*/
function real_escape($str){
global $con;
$escape = mysqli_r... | true |
04e565a49336ce9aef869ef5a313d48dcd57ac7c | PHP | DSAndreee/form-to-telegram | /send.php | UTF-8 | 1,071 | 2.921875 | 3 | [] | no_license | <?php
function telegram($mail, $subject, $message){
$key = "botXXXXXXXXX:AABBCCDDEEFFGGHHIIJJKKLLMMNNOO";
$chat_id = "123456789";
if(isset($mail) && isset($subject) && isset($message)){
$ch = curl_init("https://api.telegram.org/".
$key."/sendMessage?chat_id=".
$chat_id."&text=De : ".
$mail."%0aSujet... | true |
b0c8d559767827f394464ffc3bf9670e2333a266 | PHP | UnderDogg/slick | /framework/Slick/Database/Query/Ddl/Utility/ForeignKey.php | UTF-8 | 1,692 | 2.921875 | 3 | [
"MIT"
] | permissive | <?php
/**
* ForeignKey
*
* @package Slick\Database\Query\Ddl\Utility
* @author Filipe Silva <silvam.filipe@gmail.com>
* @copyright 2014 Filipe Silva
* @license http://www.opensource.org/licenses/mit-license.php MIT License
* @since Version 1.0.0
*/
namespace Slick\Database\Query\Ddl\Utility;
use S... | true |
4957c497783a344f641ba68d1e14b9fc116170dc | PHP | nfigueiredo1965/laravel_graficos | /app/Repositories/Core/QueryBuilder/QueryBuilderReportRepository.php | UTF-8 | 3,950 | 2.734375 | 3 | [] | no_license | <?php
namespace App\Repositories\Core\QueryBuilder;
use App\Enum\Enum;
use App\Charts\ReportChart;
use Illuminate\Support\Facades\DB;
use App\Repositories\Core\BaseQueryBuilderRepository;
use App\Repositories\Contracts\ReportRepositoryInterface;
class QueryBuilderReportRepository extends BaseQueryBuilderRepository ... | true |
5da47fd9195cf42a5d98c2d1fc849e88dfc79fba | PHP | se3/xmp | /xmp/webpad/plugins/_blogging/class.bloggerclient.php | UTF-8 | 6,487 | 2.53125 | 3 | [] | no_license | <?php
/***************************************************************************\
===========================
PHP BLOG API IMPLEMENTATION
===========================
This library of PHP code was produced by the work of two people;
Beau Lebens
Bill Lazar
The intention was to create a set of c... | true |
f8f49658efebad33aabbf82e80aa8a30a1aa27d5 | PHP | openwebsolns/techscore | /lib/users/EULAPane.php | UTF-8 | 2,048 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
use \users\AbstractUserPane;
/**
* Displays the End-User License Agreement for TechScore and
* requests/processes the signature
*
* @author Dayan Paez
* @version 2010-07-25
*/
class EULAPane extends AbstractUserPane {
public function __construct(Account $user) {
parent::__construct("Sign agreement",... | true |
79d156ec5af4a7697516f2fa7f7407dd25f0d76e | PHP | kylian-duval/TP_FINAL_PHP_MYSQL | /inscrire.php | UTF-8 | 2,416 | 2.859375 | 3 | [] | no_license | <?php try {
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Inscription</title>
<!--ajout du css pour le style -->
<link rel="stylesheet" href="inscrire.css">
<!-... | true |
880bed1cc81cbc0f55707d2fa3216dba698740a1 | PHP | Kelvin-Freitas/PHP | /Email com PHP/index.php | UTF-8 | 502 | 2.796875 | 3 | [] | no_license | <?php
require __DIR__ . "/vendor/autoload.php";
echo "<h1>PHP Mailer</h1><br>";
use Source\Support\Email;
$email = new Email();
$email->add(
"Meu email de teste", //assunto
"<h1>Ola estou lhe enviando esse email como teste, não é preciso responder!</h1>", //corpo da mensagem
"Fulano",
"fulano@gmail... | true |
5ffd41a41a816ca8be810ee46104d2150d9eee9a | PHP | freedom5566/codewars | /7kyu/fundamentals/基礎/0geometric-progression-sequence/php/a.php | UTF-8 | 535 | 3.796875 | 4 | [] | no_license | <?php
function geometric_sequence_elements(int $a, int $r, int $n): string {
$str =[];
$str[] =$a;
for($i=0;$i<$n-1;$i++){
$str[] = $str[$i]*$r;
}
return implode(', ',$str);
}
function geometric_sequence_elements(int $a, int $r, int $n): string
{
$numbers = $a;
while(--$n) $numbers .= ... | true |
a8a79e12c5dc26954408add752c21f3294687136 | PHP | ICC2000679/prodevweb | /controllers/Users.php | UTF-8 | 17,626 | 2.515625 | 3 | [] | no_license | <?php
class Users extends Controller {
/*>>>>>>>>>>>>>>>>>>>>*/
#<---> construct <--->#
/*<<<<<<<<<<<<<<<<<<<<*/
private $userModel;
private $cartModel;
private $vkey ;
public function __construct(){
new Session();
$this->userModel... | true |
d8edb75c0ffd16f851fc35fafc68a94fa43b0dd6 | PHP | schachtjOSU/SWEng1-TLDRerr-Project | /Group21_ProjectB_Submittal/Group21_ProjectB_Submittal/rating_added.php | UTF-8 | 994 | 2.84375 | 3 | [] | no_license | <?php
// Turn on error reporting
ini_set('display_errors', 'On');
// Get the location of database and all the password stuff from a different file
include('admin/data.user.php');
// Connect to database
$mysqli = new mysqli($dbhost, $dbuser, $dbpass, $dbname);
// Error check the db connection
if($mysqli->connect_errn... | true |
c2a9112467a68c853d07801c87fb361f75b5d5d7 | PHP | juanp25/UAC-104-grupo-3 | /sysrecor/rol/rol.model.php | UTF-8 | 2,063 | 3.125 | 3 | [] | no_license | <?php
class RolModel
{
private $pdo;
public function __CONSTRUCT()
{
try
{
$this->pdo = new PDO('mysql:host=localhost;dbname=ae', 'root', '');
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch(Exception $e)
{
die($e->getMessage());
}
}
public function Lis... | true |
8869730505492d2c27dfd330b79e4cd807d18175 | PHP | akbarazimifar/php-search-engine | /config.php | UTF-8 | 381 | 2.609375 | 3 | [] | no_license | <?php
ob_start();
$db_name = 'searchengine_database';
$db_host = 'localhost';
$db_user = 'root';
$db_pass = '';
try {
$con= new PDO('mysql:dbname='.$db_name.';host='.$db_host.';charset=utf8mb4', $db_user, $db_pass);
$con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
} catch (PDOException ... | true |
f7404bde4594be0217573897f125bd9e600a0002 | PHP | wnik/symfony-mini-crm | /src/Factory/Invoice/InvoiceFactory.php | UTF-8 | 735 | 2.640625 | 3 | [] | no_license | <?php
namespace App\Factory\Invoice;
use App\Entity\Invoice\Invoice;
use App\Entity\Invoice\InvoiceInterface;
use App\Entity\Invoice\TypeInterface;
use App\Service\InvoiceNumberGenerator\InvoiceNumberGeneratorInterface;
final class InvoiceFactory implements InvoiceFactoryInterface
{
private $invoiceNumberGenerat... | true |
ce653b03a9ea511b652a8968881fa3610b8c39bb | PHP | pixelfederation/swoole-bundle | /src/Bridge/Symfony/Bundle/DependencyInjection/CompilerPass/StatefulServices/UnmanagedFactoryTags.php | UTF-8 | 2,931 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace K911\Swoole\Bridge\Symfony\Bundle\DependencyInjection\CompilerPass\StatefulServices;
use Symfony\Component\DependencyInjection\ContainerBuilder;
final class UnmanagedFactoryTags
{
/**
* @var array<UnmanagedFactoryTag>
*/
private array $tags;
/**
*... | true |
4566796fc74418988b7b9e60d8e619d504955bb9 | PHP | evapamfil/exam3 | /tests/unit/calculator/CalculatorTest.php | UTF-8 | 2,366 | 2.84375 | 3 | [] | no_license | <?php
class CalculatorTest extends \PHPUnit\Framework\TestCase
{
/** @test */
public function canSetSingleOperation()
{
$addition = new App\Calculator\Addition;
$operands = [5, 10];
$addition->setOperands($operands);
$calculator = new \App\Calculator\Calculator;
$ca... | true |
6d6acf47f1a008d90de1aff28f5c47f028900f80 | PHP | blzkiten/PixCraw | /controllers/CrawController.php | UTF-8 | 2,463 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace app\controllers;
use Yii;
use yii\web\Controller;
include("../components/simple_html_dom.php");
class CrawController extends Controller {
public function actionIndex() {
return $this->render('view_craw');
}
public function actionGetlink() {
$articleCode = $_GET['artCode'... | true |
77d96bc0fa237d3f7bde5cf98b547cf225633d31 | PHP | murker/CSC412---Advanced-Software-Lab | /visitor.php | UTF-8 | 805 | 2.921875 | 3 | [] | no_license | <?php
// Create connection
$con = mysqli_connect('setapproject.org', 'csc412', 'csc412', 'csc412');
if (mysqli_connect_errno($con)) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con, "SELECT * FROM YMCMB_table");
while ($row = mysqli_fetch_array($result)) {... | true |
3928aa61bc84f0170fcac710019287370a3b07b2 | PHP | marscore/hhvm | /hphp/test/slow/object_magic_method/746.php | UTF-8 | 165 | 2.640625 | 3 | [
"Zend-2.0",
"PHP-3.01",
"MIT"
] | permissive | <?php
class Test {
public function __call($name, $args) {
var_dump($args);
}
}
<<__EntryPoint>>
function main_746() {
$test = new Test();
$test->test();
}
| true |
4a6fc49e55cde96f17e4f3ca6745759e7654bb8a | PHP | vchebotarev/symfony-skeleton | /src/Doctrine/Column/Name.php | UTF-8 | 407 | 2.625 | 3 | [] | no_license | <?php
namespace App\Doctrine\Column;
use Doctrine\ORM\Mapping as ORM;
trait Name
{
/**
* @var string
* @ORM\Column(name="name", type="string", options={"default": ""})
*/
protected $name = '';
public function getName() : string
{
return $this->name;
}
public function ... | true |
21f43676bf9dae06ddfce03e6c244694a7205531 | PHP | Shakil1081/Doctor-prescription-generation- | /acp_update.php | UTF-8 | 646 | 2.53125 | 3 | [] | no_license | <?php
include('db.php');
if (isset($_POST['id'])){
$id = mysqli_real_escape_string($conn,$_POST['id']);
}
if (isset($_POST['name'])){
$name = mysqli_real_escape_string($conn,$_POST['name']);
}
if (isset($_POST['comment'])){
$comment = mysqli_real_escape_string($conn,$_POST['comment']);
}
if($id !== 0){
$conn = n... | true |
d9d52a92614ba42f33bf0bb9c732c2b79291ff16 | PHP | Faisal21063/Fashion | /wp-content/plugins/optimole-wp/inc/image_properties/property_type.php | UTF-8 | 492 | 2.75 | 3 | [
"GPL-1.0-or-later",
"LicenseRef-scancode-unknown-license-reference",
"GPL-2.0-only",
"Apache-2.0",
"GPL-2.0-or-later",
"GPL-3.0-only"
] | permissive | <?php
/**
* Class Optml_Property_Type
* Base Property definition/
*/
abstract class Optml_Property_Type {
use Optml_Validator;
use Optml_Normalizer;
/**
* Return property value.
*
* @return mixed
*/
abstract public function get();
/**
* Set property value.
*
* @param mixed $value Value to set.
... | true |
f3f76b770a5b46464decf5b85b429caf4008fd18 | PHP | mygento/jeeves | /src/Jeeves/Model/Crud/Layouts.php | UTF-8 | 1,899 | 2.515625 | 3 | [] | no_license | <?php
namespace Mygento\Jeeves\Model\Crud;
use Mygento\Jeeves\Generators\Crud\Layouts as Generators;
use Mygento\Jeeves\IO\IOInterface;
use Mygento\Jeeves\Model\Generator;
class Layouts extends Generator
{
public function __construct(IOInterface $io)
{
$this->setIO($io);
}
public function ge... | true |
337004151fcf4308b998fcc51a66bb874149f2e6 | PHP | share-solutions/sharepress | /src/SharePress/Helpers/Strings.php | UTF-8 | 574 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: PedroGaspar
* Date: 09/02/2018
* Time: 23:05
*/
namespace share\SharePress\Helpers;
class Strings
{
public function slugToCamelCase ($string, $ucfirst = false) {
$transform = preg_replace_callback('/[-_](.)/', function ($matches) {
return strtoupper($matches[1]);
... | true |
31b3481183ac9ea31a39e9a34aa812175e5fde4e | PHP | ciih/bcedu | /Application/Admin/Model/SchoolInfoData.class.php | UTF-8 | 2,112 | 2.8125 | 3 | [] | no_license | <?php
/**
* 获取学校列表
* @author chenhong
*/
namespace Admin\Model;
use Think\Model;
class SchoolInfoData {
/**
* 其它信息主路径(包括:片区、分数线等)
* @var array
*/
protected static $excelTemplatePath = '/Baseinfo/';
/**
* 获取参考学校列表数据
*/
public function getSchoolData($s... | true |
5fdbcfb3d7edbd88f21e25f758ec4a3e1e818e06 | PHP | simbanic/webdev-challenge | /laravel_csv_demo/app/Repositories/AuctionStockFileRepositoryInterface.php | UTF-8 | 446 | 2.84375 | 3 | [] | no_license | <?php
namespace App\Repositories;
interface AuctionStockFileRepositoryInterface
{
/**
* Get particular auction stock file by id
*
* @param string
*/
public function get($id);
/**
* Insert auction stock file record
*
* @param string
*/
public function insert(ar... | true |
ca9468e31ae7ef2f6b2a12b84e54a849fb6ec53e | PHP | treehouselabs/slugifier | /src/TreeHouse/Slugifier/Slugifier.php | UTF-8 | 4,897 | 3.171875 | 3 | [
"MIT"
] | permissive | <?php
namespace TreeHouse\Slugifier;
use TreeHouse\Slugifier\Translation\CommonTranslator;
use TreeHouse\Slugifier\Translation\EntityTranslator;
use TreeHouse\Slugifier\Translation\QuoteTranslator;
use TreeHouse\Slugifier\Translation\TranslatorInterface;
class Slugifier
{
/**
* @var TranslatorInterface[]
... | true |
0cf4e07b704dd61e98ff1d1fdadc71acbcea5e1a | PHP | Pablobb97/QueHagoHoy | /AppPabloProyectoQueHago/app/Http/Controllers/PeticionController.php | UTF-8 | 3,572 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use App\Models\Usuario;
use App\Models\Guardar;
class PeticionController extends Controller
{
function devolverJsonUsuario($nombre){
$usuario=Usuario::All();
$esteUsuario="Usuario desconocido";
foreach($usuario as $user){
if ($user->nombre... | true |
61e95c4daa1609f08e54efbccbe8cc3e92960d2b | PHP | jiabrs/demo_codeignitor_datatable | /application/helpers/ldap_helper.php | UTF-8 | 465 | 3.046875 | 3 | [] | no_license | <?php
/**
* Converts ldap_get_entries returned resource to
* associative array keyed on requested ldap fields
*
* @param resource $ldap_entries
* @return array:
*/
function entries_to_assoc($ldap_entries)
{
$assoc_entries = array();
for ($i=0;$i<$ldap_entries['count'];$i++)
{
for ($j=0;$j<$ldap_entries[$i]... | true |
5d13ea1e320f07c447e9abc9eaaae77ee9e55280 | PHP | nikic/extension-1 | /tests/methods/precision.phpt | UTF-8 | 607 | 2.96875 | 3 | [
"MIT"
] | permissive | --TEST--
Decimal::precision
--SKIPIF--
<?php
if (!extension_loaded("decimal")) echo "skip";
?>
--FILE--
<?php
use Decimal\Decimal;
/**
* Shortcut to construct a new decimal.
*/
function decimal(...$args) { return new Decimal(...$args); }
var_dump(decimal()->precision());
var_dump(decimal(5)->precision());
var_dump(... | true |
eb3a6f3d6c9bf56ac639f741de28643307a676cc | PHP | azhai/Ham | /ham/ham.php | UTF-8 | 6,372 | 2.859375 | 3 | [
"BSD-2-Clause"
] | permissive | <?php
/**
* @author James Cleveland <jc@blackflags.co.uk> Ryan Liu <azhai@126.com>
* @version 0.2
*
* 简化自James Cleveland的Ham
*
* Usage:
* route('/<int>', 'BlogView', array('get', 'post'));
* run();
*
* class BlogView extends View
* {
* public $blogs;
*
* public function prepare()
* {
* ... | true |
444d9ae86cc515f4cf5e07fa45586173e7248874 | PHP | thuvarahan97/MoraExams | /admin/assets/marks.edit.inc.php | UTF-8 | 2,712 | 2.53125 | 3 | [] | no_license | <?php
$subject_option = array(
'01' => 'Physics',
'02' => 'Chemistry',
'09' => 'Biology',
'10' => 'Combined Mathematics',
'20' => 'Information and Communication Technology'
);
$subject_num = "";
$subject_name = "";
if(isset($_GET['subject'])) {
foreach($subject_option as $subj_num => $subj_nam... | true |
5c9f13c3503d550509b4e4b7869a51af757cd5d6 | PHP | PortlandLabs/slackbot | /src/Slack/Api/Payload/PayloadFactory.php | UTF-8 | 1,093 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace PortlandLabs\Slackbot\Slack\Api\Payload;
use CL\Slack\Payload\ChatPostMessagePayload;
class PayloadFactory
{
/**
* Create an error message Payload
* @param string $message
* @param string $channel
* @return \CL\Slack\Payload\ChatPostMessagePayload
*/
public function ... | true |
ff1e8b37b744a9693e13fca6e3728206a021069a | PHP | Vanyok/pay-pal-yii-integration | /models/Item.php | UTF-8 | 1,463 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: ivan
* Date: 3/12/19
* Time: 1:01 PM
*/
namespace vanyok\paypalyii\models;
use Yii;
use yii\base\Model;
class Item extends Model
{
public $name;
public $description;
public $sku;
public $value = 0;
public $category;
public $quantity = 1;
public... | true |
2589326ed849c79cb7b35f5c4346b278f6cfae0a | PHP | vanyabursak/php-lessons | /oop/encapsulation.php | UTF-8 | 2,256 | 3.171875 | 3 | [] | no_license | <?php
//Инкапсуляция - механизм языка, позволяющий ограничить доступ
// одних компонентов проограмы к другим. Осуществляется ето з помощю МОДИФИКАТОРОВ ДОСТУПА
//Модификатори доступа
//Public(общедоступный) - позволяет получить доступ к свойствам и методам класса из любого места
//Protected(за... | true |
d785a64a957e70dcd574658c7965a31ef4991f7d | PHP | Kornrathak/HostingDetail | /src/app/spare_part/Crud.php | UTF-8 | 9,566 | 2.6875 | 3 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="logos.ico">
<meta charset="UTF-8">
<meta http-equiv="Content-Language" content="th">
<meta http-equiv="content-Type" content="text/html; charset=window-874">
<meta http-equiv="content-Type" content="text/html; charset=tis-620"> ... | true |
cc452892b5cf204557552048efc07c720c8eca69 | PHP | jeemb/places-visited | /src/places.php | UTF-8 | 590 | 3 | 3 | [] | no_license | <?php
class Place
{
private $location;
private $date;
function __construct($location,$date)
{
$this->location = $location;
$this->date = $date;
}
function getLocation()
{
return $this->location;
}
function getDate()
{
return $this->date;
}
... | true |
ccb0ca9b57cc15125a95a0770d80dc340ce9953b | PHP | hnmogithub/hnvagt | /system/html/html.php | UTF-8 | 2,221 | 2.78125 | 3 | [] | no_license | <?php namespace system;
use \schedule as schedule;
use \template as template;
/**
* Handles the html part of the site
*/
class html
{
/** @var Twig_Loader_Filesystem $loader */
private $loader = null;
/** @var Twig_Environment $twig */
private $twig = null;
public function __construct ()
{
schedule::add ( ... | true |
67861597914c14e389b3df01a43e838300bb6da9 | PHP | mvhenten/Nano | /library/Nano/Form/Validator/Abstract.php | UTF-8 | 1,291 | 3.015625 | 3 | [] | no_license | <?php
/**
* library/Nano/Form/Validator/Abstract.php
*
* @author Matthijs van Henten <matthijs@ischen.nl>
* @package Nano
*/
abstract class Nano_Form_Validator_Abstract {
protected $_options = array();
protected $_messages = array();
/**
*
*/
public final function __cons... | true |
1d4383daca70a45c7c6933cad3926594ccb3170f | PHP | cjwhite92/TeamworkEnglewoodGit | /app/models/GitCommands.php | UTF-8 | 3,254 | 3.234375 | 3 | [] | no_license | <?php
use GitWrapper\GitWrapper;
class GitCommands extends AbstractFileSystem
{
/**
*
* GitWrapper object that will be used to execute Git commands to local file system.
*
* @var GitWrapper
*/
private $wrapper;
/**
*
* In order for the parent's constructor to be called,
* need to pass user name and pro... | true |
ac416ffdc03af2cd2d830352d44bb591752dd335 | PHP | david9898/SAIP | /App/Repository/ClientRepository.php | UTF-8 | 7,589 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace App\Repository;
use App\DTO\ClientDTO;
use App\DTO\OldDTO;
use Core\Database\PrepareStatementInterface;
class ClientRepository implements ClientRepositoryInterface
{
private $db;
public function __construct(PrepareStatementInterface $db)
{
$this->db = $db;
}
public func... | true |
ee2c3886480c11d632ba53584579b51ffa1e8b30 | PHP | SulemanTanveer/ProjectPlannerAndScheduler | /PPS/emailVerification.php | UTF-8 | 936 | 2.734375 | 3 | [] | no_license | <?php // include SMTP Email Validation Class
require_once('php-smtp-email-validation/trunk/smtp_validateEmail.class.php');
$connect = mysqli_connect("localhost", "root", "", "PPS");
$email1 = mysqli_real_escape_string($connect, $_POST["email"]);
$email1=stripslashes( $email1);
// the email to validate
$ema... | true |
17af697127adbc3c180ee553d3002dd19d4d1355 | PHP | atospeps/resto | /include/resto/RestoLicense.php | UTF-8 | 9,504 | 2.640625 | 3 | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | <?php
/*
* Copyright 2014 Jérôme Gasperi
*
* 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 applicab... | true |
25b8eb6c014a8adc25bd63bb3743b7ec04edd10a | PHP | scoutapp/scout-apm-php | /src/Extension/PotentiallyAvailableExtensionCapabilities.php | UTF-8 | 1,903 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Scoutapm\Extension;
use Throwable;
use function array_map;
use function extension_loaded;
use function function_exists;
use function phpversion;
use function scoutapm_enable_instrumentation;
use function scoutapm_get_calls;
final class PotentiallyAvailableExtensionCapabilit... | true |
15b36f51d1dc03b52acb1d0f6ad1199858dacefe | PHP | philasearch/php-route-helper | /lib/Philasearch/RouteHelper/RouteArray.php | UTF-8 | 1,006 | 3.046875 | 3 | [] | no_license | <?php
/**
* RouteArray.php
*
* @author Thomas Muntaner thomas.muntaner@gmail.com
* @copyright 2014 Thomas Muntaner
* @version 1.0.0
*/
namespace Philasearch\RouteHelper;
use Philasearch\RouteHelper\Exceptions\RouteNotFoundException as NotFound;
/**
* Class RouteArray
*
* This class gets the routes fro... | true |
b023ec3766cf33c43a8452b3b52c043a72c84f16 | PHP | phOnion/interfaces | /src/State/Interfaces/HistoryInterface.php | UTF-8 | 222 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Onion\Framework\State\Interfaces;
use Traversable;
interface HistoryInterface extends Traversable
{
public function add(string $from, string $to, array $arguments): void;
}
| true |
af78790c1d65ef003cb1337591b9ec2b792cd5cf | PHP | andrixh/rotor | /Rotor/Assets/Asset.php | UTF-8 | 5,051 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace Rotor\Assets;
use Rotor\Environment;
//use Rotor\Config;
use lessc;
use scssc;
use Minify_CSS_Compressor;
use JSMin;
class Asset
{
/**
* @var AssetManager
*/
protected $manager;
protected $name;
protected $filename;
protected $type;
protected $inline = false;
pro... | true |
7232c045de6aadd03eca568900175f8f0abdbbfa | PHP | ouracademy/big-deprecated | /app/Domain/Event/EventRoleType.php | UTF-8 | 478 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php namespace App\Domain\Event;
use App\Domain\Support\NamedObject;
class EventRoleType{
use NamedObject;
public static $EVENT_ROLE_TYPES;
//Used to don't access EventRole::$EVENT_ROLE_TYPES
public static function __callStatic($name, $arguments)
{
return self::$EVENT_ROLE_TYPES[$nam... | true |
5674f91e91cb2f1ab31d4d4dfe88277c6f63d998 | PHP | irene-fdez/smash_padel | /Models/INSCRIPCION_Model.php | UTF-8 | 2,947 | 2.625 | 3 | [] | no_license | <?php
class INSCRIPCION_Model
{
var $mysqli;
function __construct($inscripcion)
{
$this->inscripcion = $inscripcion;
include '../Models/DB/BdAdmin.php';
$this->mysqli = ConnectDB();
}
//Funcion para añadir inscripciones a la BD
function ADD(){
$fecha = $thi... | true |
6e2f8bb999dca62b5e1d1167086bb9b717a80d86 | PHP | WellingtonPessanha/ARA0062- | /servico/Bd.php | UTF-8 | 910 | 2.859375 | 3 | [] | no_license | <?php
class Bd {
private $conn;
function __construct() {
/* Connect to a MySQL database using driver invocation */
$this->dsn = 'mysql:dbname=id14818847_usuario_3002;host=localhost';
$this->user = 'id14818847_wricardo';
$this->password = 'dw781qaU5N4@f/B]';
tr... | true |
349e4517fc4fcb42a793d6334fc370e32a1157f5 | PHP | CodePeng/PHPTest | /filesystem/fopen_readloop.php | UTF-8 | 701 | 2.84375 | 3 | [] | no_license | <?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
if ($_SERVER['SERVER_NAME'] == 'localhost') {
$fileName = '/Users/pengzhou/private/filetest_02.txt';
} else if ($_SERVER['SERVER_NAME'] == 'codepeng.com' || $_SERVER['SERVER_NAME'] == 'www.codepeng.com') {
$fileName = '/home/users/web/b1060/ipg.codep... | true |
24642092aa6dbaf6a480ef8ae59b3269fbdf3ff0 | PHP | LudovicVa/WityCMS | /apps/news/front/view.php | UTF-8 | 776 | 2.5625 | 3 | [] | no_license | <?php
/**
* News Application - Front View - /apps/news/front/view.php
*/
defined('IN_WITY') or die('Access denied');
/**
* NewsView is the Front View of the News Application
*
* @package Apps
* @author Johan Dufau <johan.dufau@creatiwity.net>
* @author Julien Blatecky <julien.blatecky@creatiwity.net>
* @vers... | true |
ad62b66b7c523055164a680c5b96d5df21d3cae5 | PHP | skwebs/php-oops-crud-ajax | /action.php | UTF-8 | 4,034 | 2.796875 | 3 | [] | no_license | <?php
/**
* Enable error reporting
*/
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
/**
* Created Autoloader
*/
spl_autoload_register(function ($class) {
$classes = __DIR__."/classes/".$class.".php";
if (file_exists($classes)){
require $classes;
}else{
... | true |
a53635f0112e5aa7bf422bcd25a004f83fc12b96 | PHP | houssem789/pumkinTestApi | /src/Path/PathInterface.php | UTF-8 | 245 | 2.890625 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace App\Path;
interface PathInterface
{
//public static function from(string $path): PathInterface;
//public function cd(string $newPath): PathInterface;
//public function current(): string;
}
| true |
f08e412c9cd57bf26f1d8049d24f3ab669e5df09 | PHP | lammensj/resilient-robo | /src/Core/Plugins/RoboPlugin/AbstractRoboPlugin.php | UTF-8 | 741 | 2.5625 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace Resilient\Core\Plugins\RoboPlugin;
use Resilient\Core\Config\ConfigFactoryInterface;
use Resilient\Core\RoboPlugin\RoboPluginInterface;
use Robo\Tasks;
/**
* Class AbstractRoboPlugin.
*/
abstract class AbstractRoboPlugin extends Tasks implements RoboPluginInterface
{
... | true |
04be0f077ae601ebcc8eb6c61f74e22bbe43a512 | PHP | iandees/swimtimes | /swimtimes/lib/symfony/controller/sfController.class.php | UTF-8 | 16,964 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of the symfony package.
* (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
* (c) 2004-2006 Sean Kerr.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* sfController directs a... | true |
bbc287f60e394473e3848bedd3e30261504e1627 | PHP | Ibrahim-GH/test-api | /database/factories/ParameterFactory.php | UTF-8 | 739 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace Database\Factories;
use App\Models\Attribute;
use App\Models\Parameter;
use Illuminate\Database\Eloquent\Factories\Factory;
class ParameterFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Parameter::class;... | true |
994981411552ea98dd02ad8689e865a4e2be10a3 | PHP | AlinaSM/TiendaCoyote | /php/Models/ClientesModel.php | UTF-8 | 3,185 | 2.8125 | 3 | [] | no_license | <?php
require_once('Model.php');
class ClientesModel extends Model{
private $id;
private $alias;
private $nombre;
private $apellidos;
private $contrasena;
public function create( $data = array() ){
foreach($data as $key => $value){
//Variables variables (variable dinamica)
... | true |
eb43811ade26a4063edbd0ab3e0f0d18179d3c89 | PHP | wimski/laravel-beatport | /tests/Processors/Resources/GenreResourceProcessorTest.php | UTF-8 | 2,209 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace Wimski\Beatport\Tests\Processors\Resources;
use Wimski\Beatport\Data\Genre;
use Wimski\Beatport\Enums\RequestTypeEnum;
use Wimski\Beatport\Processors\Resources\GenreResourceProcessor;
use Wimski\Beatport\Tests\TestCase;
class GenreResourceProcessorTest extends TestCase
{
/**
* @var GenreReso... | true |
e118349a46dbaf5f0f300136e3600f6381bca86b | PHP | hoanghongchuong/noithat_aahome | /public/php/classes/modules/accordion.class.php | UTF-8 | 1,740 | 3 | 3 | [
"MIT"
] | permissive | <?php
// STEP 2 - CREATE CLASS (IF NOT HAVE) IN classes dir
// IF HAVED NEXT TO STEP 3
// JUST COPY AND EDIT PLACE WITH * SIGN
// List of buttons class
class Accordion{
public $el;
public $temp = 'accordion.temp.html'; // edit temp name here *
public $path = 'template/modules'; // edit path name here *
... | true |
65b4424ee4873fb6b094d5a1140d4a73ef7b6ef9 | PHP | masamitawara/mylife | /app/Http/Controllers/Admin/foodController.php | UTF-8 | 1,153 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Admin;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class foodController extends Controller
{
public function add()
{
return view('admin.food.create');
}
public function create(Request $request)
{
// Varidationを行う
$this->... | true |
df4848408326c39ad38c1be40e22b76ae77fed27 | PHP | phacility/phabricator | /resources/sql/autopatches/20141107.phriction.popkeys.php | UTF-8 | 764 | 2.65625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
$table = new PhrictionDocument();
$conn_w = $table->establishConnection('w');
echo pht('Populating Phriction mailkeys.')."\n";
foreach (new LiskMigrationIterator($table) as $doc) {
$id = $doc->getID();
$key = $doc->getMailKey();
if ((strlen($key) == 20) && (strpos($key, "\0") === false)) {
// To be ... | true |
32effdd7b1cb1bd9893fa77db207cb214c08e54f | PHP | pcaffeine/framework | /framework/Dispatcher.php | UTF-8 | 1,949 | 2.703125 | 3 | [
"BSD-2-Clause"
] | permissive | // The author of this code is Hwi Jun KIM a.k.a pcaffeine
<?php
require_once("MetaClass.php");
require_once("WebRouter.php");
require_once("CliRouter.php");
class Dispatcher extends MetaClass {
protected $module;
protected $controller;
protected $action;
public function __construct() {
}
public functi... | true |
9e65854d0db9e3f54eae89b99a62e00d88934edc | PHP | FrederickPullen/Sfera-Dev-RC | /protected/modules/dailyReports/commands/DailyReportCommand.php | UTF-8 | 3,321 | 2.6875 | 3 | [] | no_license | <?php
/**
* Command is executed by cron.
*
* Generate daily reports and
* send to all recipients
*
* @author: Alexey K <alexey.k@scopicsoftware.com>
* @date: 11.04.2014
*/
class DailyReportCommand extends CConsoleCommand {
public function init()
{
parent::init();
Yii::import('applicati... | true |
4a1856c1f1ca53c6aca3add0e08b566986d9f8ba | PHP | svolpe43/Finance | /public/comment.php | UTF-8 | 1,114 | 2.5625 | 3 | [] | no_license | <?php
// configuration
require("../includes/config.php");
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
if (empty($_POST["comment"]))
{
apologize("You have to enter a comment first!");
}
$userinfo = query("SELECT * FROM users WHERE id = ?", $_... | true |
502bc3722c4bd2b53f03e17f75a26489b462b77b | PHP | danieleguido/microbe | /microbe/lib/ApiController.php | UTF-8 | 633 | 2.609375 | 3 | [] | no_license | <?php
/**
* a base class for api text-only controller
*/
class ApiController extends Controller{
public $response;
public function init(){
header( "Content-type: text/plain;charset=UTF-8", true );
$this->ignoreView();
$this->response = new Response();
$this->response->setStatus("ok");
$this->response-... | true |
f8ae8785f695574d5f38b25d15f5e18112ea146f | PHP | yazbahar/ojs | /src/Ojs/JournalBundle/Event/CitationEditEvent.php | UTF-8 | 2,014 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
namespace Ojs\JournalBundle\Event;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\HttpFoundation\Response;
class CitationEditEvent extends Event
{
/**
* @var Response
*/
private $response;
/**
* @var int
*/
private $journalId;
/**
* @var int
... | true |
8925d3199ba1bdf5c35fabacbaf11ccad3b66ee4 | PHP | greezybacon/phlite | /src/Text/CodecInfo.php | UTF-8 | 193 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace Phlite\Text;
abstract class CodecInfo {
static $name = false;
abstract function encode($what, $errors=false);
abstract function decode($what, $errors=false);
}
| true |
aa9588a978d44d3a92f2bf2a31f0e14860adcaed | PHP | itconsultis/composer-foundation | /tests/unit/Support/ConfigurableTest.php | UTF-8 | 1,027 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
namespace ITC\Foundation\Support\Test;
use ITC\Foundation\Support\Configurable;
class ConfigurableHost
{
use Configurable;
/**
*
*
*/
public function defaults()
{
return [
'foo' => 'one',
];
}
}
class ConfigurableTest extends \TestCase
{
pub... | true |
93e03ec34db0e1e25a5e7973a29d7674adcede58 | PHP | BGCX261/zibo-svn-to-git | /trunk/zibo_modules/zibo.admin/src/zibo/admin/view/system/ConfigurationView.php | UTF-8 | 937 | 3.046875 | 3 | [] | no_license | <?php
namespace zibo\admin\view\system;
use zibo\core\View;
/**
* Configuration view
*/
class ConfigurationView implements View {
/**
* The configuration to display
* @var array
*/
private $configuration;
/**
* Constructs a new configuration view
* @param array $configuration... | true |
972417d2dd104329f494cc19fcd40cb9005b0c6b | PHP | paolo-zizzo/runtrack2 | /jour05/job04/index.php | UTF-8 | 411 | 3.625 | 4 | [] | no_license | <?php
function calcule($a,$operation,$b)
{
switch ($operation){
case "+":
$calcule =$a+$b;
break;
case"%":
$calcule=$a%$b;
break;
case"*":
$calcule=$a*$b;
break;
case"-":
$calcule=$a-$b;
break;
case"/":
$calcule=$a/ $b;
break;
}
ret... | true |
f68c530bb11dc910943d2dfc49b694b2d6815aed | PHP | andressikka/news_app_core | /admin/login.php | UTF-8 | 2,798 | 2.65625 | 3 | [] | no_license | <?php
session_start();
if(isset($_SESSION['username'])){
header('Location: adminView.php');
}
require_once(dirname(__FILE__)."/DBQueries/DatabaseClass.php");
use admin\DatabaseClass\DatabaseClass as DatabaseClass;
// echo session_id();
$msg = "";
if(isset($_POST['login'])){
if(isset($_POST["username"]) && isset... | true |
ba1aa06ca4f5993e89d1ffe40c53f6093f1abd7b | PHP | serbinario/UCHI | /src/Serbinario/Bundle/UCHIBundle/DAO/CandidatoDAO.php | UTF-8 | 2,869 | 2.65625 | 3 | [] | no_license | <?php
namespace Serbinario\Bundle\UCHIBundle\DAO;
use Doctrine\ORM\EntityManager;
use Serbinario\Bundle\UCHIBundle\Entity\Canditato;
/**
* Description of CandidatoDAO
*
* @author serbinario
*/
class CandidatoDAO
{
/**
*
* @var Doctrine\ORM\EntityManager
*/
private $manager;
/**
... | true |
e783ff545cc754887a3f9933cc530507c47fd8de | PHP | Dorianoss/symfony | /tests/Entity/PostTest.php | UTF-8 | 377 | 2.828125 | 3 | [] | no_license | <?php
namespace App\tests\Entity;
use App\Entity\Post;
use PHPUnit\Framework\TestCase;
class PostTest extends TestCase
{
public function testGetSetTitle()
{
$post = new Post();
$result = $post->setTitle("12345");
// assert that your calculator added the numbers correctly!
$t... | true |
850c892408ce97f208eb3b5597917e1ca4bb781f | PHP | Spacejoker/problem | /advent2018/04b.php | UTF-8 | 1,009 | 2.90625 | 3 | [] | no_license | <?php
$stdin = fopen('php://stdin', 'r');
$input = array();
while(($line = trim(fgets(STDIN))) != "")
array_push($input, $line);
sort($input);
$guard = "";
$sleep = 0;
$map=[];
for($i=0;$i<count($input);$i++) {
$split = explode(" ", $input[$i]);
if($split[2]=="Guard"){
$guard = $split[3];
if (!array_key... | true |
8f5e03f96fa2df8da1df2ba142c421d0a2d3ac21 | PHP | taoalpha/RNhelper | /index.php | UTF-8 | 4,045 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
/*
* Copyright 2010-2012 Evernote Corporation.
*
* This sample web application demonstrates the process of using OAuth to authenticate to
* the Evernote web service. More information can be found in the Evernote API Overview
* at http://dev.evernote.com/documentation/cloud/.
*
... | true |
a3c25629a743d52cb55f03acd5cd07732c6d70a7 | PHP | 10yun/php-frame-think | /src/libs/HttpLibClient.php | UTF-8 | 2,180 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace shiyun\libs;
class HttpLibClient
{
protected static $baseUrl = '';
protected static $header = [];
public static function setHeader($option = [])
{
$self = (new self());
self::$header = $option ?? [];
return $self;
}
public static function setOption($opti... | true |
d98b6056cb2b58cd8ef821b046e79e3d5f82d020 | PHP | dwvanstone/buttonmen | /src/api/api_core.php | UTF-8 | 5,171 | 3 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/**
* api_core: functions handling login, authorisation, and logout
*
* @author james
*/
/**
* Start session based on username and password
*
* @param string $username
* @param string $password
* @return bool
*/
function login($username, $password) {
require_once '../database/mysql.inc.php';
$c... | true |
755eb009adec6339aa31b0b7b7035ebb66eec216 | PHP | Moc/e107-old | /e107/e107_handlers/errorhandler_class.php | IBM852 | 1,135 | 2.625 | 3 | [] | no_license | <?php
/*
+---------------------------------------------------------------+
| e107 website system
| /error_handler_class.php
|
| Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
+---------------------... | true |
1281e0b4e84e404985afb56e2d770f2954d0fd9d | PHP | alexshadie/modelGen | /src/BuilderFile.php | UTF-8 | 3,789 | 2.828125 | 3 | [] | no_license | <?php
namespace mgen;
class BuilderFile extends CommonFile
{
public function generate()
{
$content = ["<?php", "/*", " * This file was generated by modelGen", " * VERSION: {$this->modelHash}", " * https://github.com/alexshadie/modelGen", " */", ""];
if ($this->namespace) {
$content... | true |
1bc0a9e729ba0743df69e100aeeb4877c082be76 | PHP | alphazento/zento | /src/Kernel/Booster/Events/BaseEvent.php | UTF-8 | 3,112 | 2.671875 | 3 | [] | no_license | <?php
namespace Zento\Kernel\Booster\Events;
use Illuminate\Broadcasting\PrivateChannel;
class BaseEvent
{
use \Zento\Kernel\Support\Traits\TraitLogger;
use \Illuminate\Queue\SerializesModels;
const HAS_ATTRS = [];
protected $data = [];
protected $channelName;
/**
* to tell this event ... | true |
e8be0d36a10a89cea468b30cd14b7f333994dbe8 | PHP | hugomorel2906/Feuille-de-style | /fonctions/fct ecart type.php | UTF-8 | 719 | 3.515625 | 4 | [] | no_license | <?php
//Oriane BURTSCHER et Agathe PICAVET
//PROCEDURE QUi calcule l'écart type A PARTIR d'un tableau à une colonne / liste
// ex : Sd($tab)
// paramètres à saisir :
// $tab : tableau à 1 colonne contenant : les valeurs numériques
// sortie : écart type
function Ecart_Type($tab)
{
$somme=0; ... | true |
b1ad12ff1cb0c7a5544d9997f0aa06a3fda9c9c9 | PHP | BUPT-SCS-2015-Web-Developer/LearnComputer | /API/signup.php | UTF-8 | 1,197 | 2.5625 | 3 | [] | no_license | <?php
include_once('config.php');
session_start();
unset($_SESSION['UserID']);
if (!isset($_POST['displayname'])||empty($_POST['displayname'])) {
die();
}
try {
$dbh = new PDO("mysql:host={$db_config['host']};dbname={$db_config['dbName']}", $db_config['user'], $db_config['pwd']... | true |
93eadc40b6dea3189a0f859c0b1d180f3188ba7c | PHP | slevomat/async-smtp-mailer | /src/Timer/PromiseTimer.php | UTF-8 | 586 | 2.84375 | 3 | [] | no_license | <?php declare(strict_types = 1);
namespace AsyncConnection\Timer;
use React\EventLoop\LoopInterface;
use React\Promise\Deferred;
use React\Promise\ExtendedPromiseInterface;
class PromiseTimer
{
private LoopInterface $loop;
public function __construct(LoopInterface $loop)
{
$this->loop = $loop;
}
/**
* @p... | true |
1fc4a66073f9a8c7986913e270db56a8b98dbd94 | PHP | noikiy/sc-project | /chuangying/sale/protected/modules/posterSale/models/PosterUserSaleModel.php | UTF-8 | 3,414 | 2.5625 | 3 | [] | no_license | <?php
/**
* This is the model class for table "cyPosterUserSale".
*
* The followings are the available columns in table 'cyPosterUserSale':
* @property integer $posterUserSaleId
* @property integer $userSaleId
* @property integer $userId
* @property integer $activityId
* @property integer $sex
* @property int... | true |
1df2ceea1d54aa56ac01b4199352cd7f43e0b446 | PHP | arif-srabon/BASIS_PHP_BATCH03 | /array_function/array_unshift.php | UTF-8 | 188 | 3.234375 | 3 | [] | no_license | <?php
$queue = array("orange", "banana");
array_unshift($queue, "apple", "raspberry");//this function insert value into array starting index
echo "<pre>";
print_r($queue);
echo "<pre>";
?> | true |