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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
9f3285ead6919999a87395c40f3c1da0983db2a0 | PHP | atk4/ui | /src/Table/Column/KeyValue.php | UTF-8 | 1,169 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Atk4\Ui\Table\Column;
use Atk4\Data\Field;
use Atk4\Data\Model;
use Atk4\Ui\Table;
/**
* If field have values without a relation like a status or a coded state of a process, example:
* Machine state:
* 0 => off
* 1 => powerup
* 2 => on
* 3 => resetting
* 4 => err... | true |
f3fca602764022cd54c3f84f93bdb562a902d7de | PHP | sehwanY/StudentManager | /app/Score.php | UTF-8 | 5,457 | 2.6875 | 3 | [] | no_license | <?php
namespace App;
use App\Exceptions\NotValidatedException;
use Illuminate\Database\Eloquent\Model;
/**
* 클래스명: Score
* 설명: 성적 목록 테이블에 대한 모델 속성을 정의
* 만든이: 3-WDJ 春目指し 1401213 이승민
* 만든날: 2018년 4월 26일
*/
class Score extends Model
{
// 01. 모... | true |
f871f096bcbfb90b3e8d81e7a7c5a7beccf7db9f | PHP | andrey-semenoff/forum-parser | /app/core/Message.php | UTF-8 | 338 | 3.171875 | 3 | [] | no_license | <?php
namespace Core;
class Message
{
public $topic;
public $author;
public $date;
public $text;
public function __construct(string $topic, string $author, int $date, string $text)
{
$this->topic = $topic;
$this->author = $author;
$this->date = $date;
$this->tex... | true |
57a6c959d8341a8239404cea889c7649223c8ca0 | PHP | gencer/basecamp-integration | /src/library/Config/class.SWIFT_ConfigManager.php | UTF-8 | 2,281 | 2.75 | 3 | [
"BSD-2-Clause-Views"
] | permissive | <?php
/**
* @copyright 2001-2015 Kayako
* @license https://www.freebsd.org/copyright/freebsd-license.html
* @link https://github.com/kayako/basecamp-integration
*/
/**
* Manage module configuration
*
* @author Atul Atri
*/
class SWIFT_ConfigManager extends SWIFT_Library
{
... | true |
cbd9f0a42ac4a017725332db31d82481075e1e2e | PHP | developer-run/framework | /Devrun/Tests/FileTestTrait.php | UTF-8 | 2,899 | 2.859375 | 3 | [] | no_license | <?php
/**
* This file is part of souteze.pixman.cz.
* Copyright (c) 2019
*
* @file FileTestTrait.php
* @author Pavel Paulík <pavel.paulik@support.etnetera.cz>
*/
namespace Devrun\Tests;
use Devrun\FileNotFoundException;
use Devrun\InvalidArgumentException;
use Nette\Http\FileUpload;
use Nette\Utils\FileSys... | true |
7ece75a8e7d4068ee8624a3f9c6e47d68f267afd | PHP | kelver/treinamentoPHP7.0 | /02_scalar_types/index.php | UTF-8 | 577 | 3.828125 | 4 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: kelver
* Date: 04/03/17
* Time: 01:23
*/
// php 5.0
class ClasseA
{
}
class ClasseB
{
public function get(ClasseA $a)
{
}
}
// php 5.1
class ClasseC
{
public function get(array $a)
{
}
}
// php 5.4
class ClasseD
{
public function get(ca... | true |
9d7a540719d53f9ff6a5fb200db75bf93df1ecca | PHP | philShy/yanding | /core/que.inc.php | UTF-8 | 1,937 | 2.6875 | 3 | [] | no_license | <?php
/**
* 添加提问信息的操作
* @return string
*/
function addQues(){
$arr=$_POST;
$arr['time'] = time();
if(insert("question",$arr)){
$res = sendMail($arr);
addOperate(getUserName(),'question','add',getInsertId());
alertMes("提交成功", "../contactUs.php");
}else{
alertMes("提交失败", "../contactUs.php");
}
}
/**
*删除... | true |
cf098ee65697163563925dd6188f6001b29d9dd8 | PHP | jaspervanbrian/ITELEC1C---Online-Shop | /Submit.php | UTF-8 | 2,587 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
session_start();
if(isset($_POST['submitForm'])) {
if(isset($_POST['quantity']) && isset($_POST['choice'])) {
if ($_POST['quantity'] > 0) {
$choice = $_POST['choice'];
if(($_SESSION['inventory'][$choice]['stock'] >= $_POST['quantity']) && $_SESSION['inventory'][$choice]['stock'] > 0) {
if(co... | true |
326ba99b51379024765201caad4f33171835e286 | PHP | slackbax/qa-platform | /class/classTipoEvento.php | UTF-8 | 889 | 3.203125 | 3 | [] | no_license | <?php
class TipoEvento {
public function __construct()
{
}
/**
* @param $id
* @return stdClass
*/
public function get($id): stdClass
{
$db = new myDBC();
$stmt = $db->Prepare("SELECT * FROM uc_tipo_evento WHERE tev_id = ?");
$stmt->bind_param("i", $id);
$stmt->execute();
$result = $stmt->get_re... | true |
990c9c39f079611e5edadaa0297cca92135b45fe | PHP | Tujubitti/StubORM | /Select/Cond.php | UTF-8 | 2,582 | 3.046875 | 3 | [] | no_license | <?php
namespace Stub\Select;
/**
* Abstract condition class
*
*/
abstract class Cond extends ASelect implements ISelect
{
private static $_condAliases = array(
'=' => 'Is',
'!=' => 'Not',
'>' => 'Gt',
'>=' => 'Gte',
'<' ... | true |
8a7082310f31b359de4045b49912ea4507eb8f6b | PHP | cntd/laravel-php-resque | /src/Kodeks/PhpResque/Lib/ResqueWorkerEx.php | UTF-8 | 6,547 | 2.53125 | 3 | [] | no_license | <?php namespace Kodeks\PhpResque\Lib;
use Resque_Worker;
use Resque;
use Kodeks\PhpResque\Lib\ResqueOutputRedis;
class ResqueWorkerEx extends Resque_Worker
{
protected $pid = null;
protected $queues_list = null;
protected $interactive;
public function __construct($queues, $interactive... | true |
8aec9140d31b8af7094e696fe23631662d05bda0 | PHP | Olivier-Welter/snapspot | /controller/AdministrationController.php | UTF-8 | 1,167 | 2.578125 | 3 | [] | no_license | <?php
require_once 'autoload.php';
class AdministrationController
{
private $ctrlAdminmenu;
private $ctrlConnexion;
private $ctrlAdminAppli;
private $ctrlAdminData;
public function __construct()
{
$this->ctrlAdminmenu = new AdminMenuController();
$this->ctrlConnexion = new Co... | true |
9385474163bb0b25f9775b1069a26cccf92f13d2 | PHP | ArtcalO/covid19out_PHP | /config.php | UTF-8 | 2,013 | 2.671875 | 3 | [] | no_license | <?php
session_start();
$username = "";
$email = "";
$errors = array();
$_SESSION['success'] = "";
$db = mysqli_connect('localhost', 'root', '', 'db_covid19_out');
//Register User
mysqli_set_charset($db, "utf8");
if (isset($_POST['reg_user'])){
$first_name = $_POST['first_name'];
$last_name = $_POST['last_nam... | true |
fa5320c164704ed338f96987a70234f014bf7a50 | PHP | howyi/json-schema-mapper | /src/JsonSchemaMapper/Factory/ObjectSchemaFactory.php | UTF-8 | 4,944 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace JsonSchemaMapper\Factory;
use JsonSchemaMapper\Structure\ObjectSchema;
use JsonSchemaMapper\Structure\NameInfo;
use JsonSchemaMapper\Structure\TypeInfo;
use JsonSchemaMapper\Structure\SchemaInfo;
use JsonSchemaMapper\Modifier\Detector;
use JsonSchemaMapper\Modifier\RefPointer;
use JsonSchemaMapper\Con... | true |
cdddceaa503014b8144b76693b231c554651a791 | PHP | omarfurrer/Lumenous-sample | /app/Http/Controllers/API/PayoutsController.php | UTF-8 | 1,082 | 2.765625 | 3 | [] | no_license | <?php
namespace lumenous\Http\Controllers\API;
use Illuminate\Http\Request;
use lumenous\Http\Controllers\Controller;
use lumenous\Repositories\Interfaces\PayoutsRepositoryInterface;
use lumenous\User;
use lumenous\Http\Requests\Payouts\GetUserPayoutsRequest;
class PayoutsController extends Controller {
/**
... | true |
c3429d87604074783d846c3c73e03868fc16664e | PHP | ShihabShahib/web_project | /create_class_load.php | UTF-8 | 510 | 2.5625 | 3 | [] | no_license | <?php
include"includes/db_connect.inc.php";
if(isset($_POST['class_name'])){
$class_name = $_POST['class_name'];
$sql = "SELECT * from `class` WHERE `classnumber` = '$class_name'";
$result = mysqli_query($conn, $sql);
while ($row = mysqli_fetch_assoc($result)){
$class_id = $row['classid'];
... | true |
e31d85c566562de9a383b19ff0ee3de847f9a3bc | PHP | yasmuru/ys-fedex | /src/Contract/Address.php | UTF-8 | 282 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace yasmuru\LaravelFedEx\Contract;
interface Address
{
public function getStreet(): array;
public function getCity(): string;
public function getPostCode(): string;
public function getCountryCode(): string;
public function getStateCode(): string;
} | true |
b04b05ddfba3f27e5e6fac1fadaeaa99a8a24ad7 | PHP | ferguevara510/BonsaiGuevara | /app/vista/registrarBonsai.php | UTF-8 | 10,636 | 2.734375 | 3 | [] | no_license | <?php
require_once "../../configuracion/env.php";
//Variables de los inputs
$nombreCi = "";
$nombreCo = "";
$precio = "";
$estilos = "";
$edad = "";
$especies = "";
//Variables para verificar errores
$imgERR = "";
$namCiERR = "";
$namCoERR = "";
$prcERR = "";
$edadErr = "";
//pide el metodo post
if ($_SERVER["R... | true |
6003e846bcf6a0971ff0184945db3333cf1c4250 | PHP | GeckoPackages/GeckoMemcacheMock | /src/MemcacheMock/MemcacheObject.php | UTF-8 | 1,209 | 2.875 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of the GeckoPackages.
*
* (c) GeckoPackages https://github.com/GeckoPackages
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace GeckoPackages\MemcacheMock;
/**
* Represent a value stored in the MemcachedMoc... | true |
8cc57d20404aab313c8f65b49ab3cd263f5fd2c4 | PHP | Rvvijays/Projects | /teacherScrapping.php | UTF-8 | 3,069 | 2.734375 | 3 | [] | no_license | <?php
include "simple_html_dom.php";
$conn = new mysqli('localhost','root','server','student');
if($conn){
echo "";
}
else{
die("Connection Failed because ".$conn->connect_error);
}
//echo "Included";
$html = str_get_html(file_get_contents('https://cse.gndec.ac.in/sites/default/files/TT_... | true |
f4466862f054687bdec3bcdd9bd8584046d51297 | PHP | aosanna/RPG-CCIAJOUR | /src/Controller/NewPersoController.php | UTF-8 | 2,063 | 2.546875 | 3 | [] | no_license | <?php
namespace App\Controller;
use App\Core\Abstract\AbstractController;
use App\Entity\Personnage;
use App\Repository\PersonnageRepository;
class NewPersoController extends AbstractController
{
public function FormNewPerso ()
{
if (!$this->checkSecure()){
header('Location: Connecti... | true |
1694923eecd5ca0f7faf68a79fe50a566360d5e4 | PHP | suprin-bajracharya/panel-login | /app/Http/Controllers/PostsController.php | UTF-8 | 3,964 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Post;
use Session;
use Gate;
use Auth;
class PostsController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function __constr... | true |
6e2f6f516bf21e198d4ca1580ab6942cd42c16dc | PHP | yueyuzhao/leetcode-php | /0448-find-all-numbers-disappeared-in-an-array/SolutionTest.php | UTF-8 | 456 | 2.953125 | 3 | [] | no_license | <?php
require_once './Solution.php';
use PHPUnit\Framework\TestCase;
final class SolutionTest extends TestCase
{
public function testSolution()
{
$s = new Solution();
$this->assertEquals([5, 6], $s->findDisappearedNumbers([4, 3, 2, 7, 8, 2, 3, 1]));
}
public function testSolution2()... | true |
9fe569551ab3339407674ed42b9b08ca74a33e7b | PHP | w3c/i18n-tests | /tools/_make-data-file.php | UTF-8 | 3,153 | 2.8125 | 3 | [] | no_license | <?php
// read in template
$template = file_get_contents('results_template.en.html');
// make substitutions in template
$template = str_replace("SUB§FILENAME", $_GET['fnameShadow_results'], $template);
$template = str_replace("SUB§BASE", $_GET['baseShadow_results'], $template);
$template = str_replace("SUB§BATCH", $_... | true |
c02e502895b95262cf88fcc3812790621ddf7bbe | PHP | GERCOC/SkyEng | /Index.php | UTF-8 | 1,109 | 2.96875 | 3 | [] | no_license | <p>Задание 1</p>
<?php
function foo($str1,$str2){
echo strlen($str1);
echo strlen($str2);
$n = strlen($str1) - strlen($str2);
if ($n > 0) {
$i = 0;
while ($i++ < $n) {
$str2 = substr_replace($str2, "0", 0, 0);
}
} else {
$i = 0;
while ($i-- > $n) {... | true |
e616e344c1bb3edfe2f97750cfb3a2caa965bf1a | PHP | johnhwatts/Codeup-Web-Exercises | /public/php/my-favorite-things.php | UTF-8 | 1,357 | 3.0625 | 3 | [
"Apache-2.0"
] | permissive | <?php
//Create an array of your favorite things.
function pageController() {
$data = [];
$data["myFavThings"] = ['food', 'beer', 'cycling', 'fishing', 'music'];
return $data;
}
extract(pageController());
?>
<!-- loop through this array and display each element inside your HTML.
Use an HTML table for this displa... | true |
870e48224c63046ae6fda1a10bb3e514e9169717 | PHP | EdwinDayot/shorty-framework | /src/Framework/Routing/Router.php | UTF-8 | 6,861 | 2.953125 | 3 | [
"MIT"
] | permissive | <?php
/**
* Router.php.
*
* @author Edwin Dayot
*/
namespace Shorty\Framework\Routing;
use DI\Container;
use GuzzleHttp\Psr7\Response;
use Psr\Http\Message\RequestInterface;
use Shorty\Framework\Routing\Exceptions\HTTPException;
/**
* Class Router.
*/
class Router
{
private $routes = [
'GET' => [],... | true |
cacd6030fa3007b690cc730aa1c9964523465926 | PHP | wPaniagua/Compra-y-venta-de-toda-papada-Back | /backend/verificacion_email.php | UTF-8 | 1,452 | 2.578125 | 3 | [] | no_license | <?php
$connect = new PDO('mysql:host=localhost:3306;dbname=mydb', 'root', '');
//session_start();
$message = '';
if(isset($_GET['activation_code']))
{
$query = "
SELECT * FROM persona p
WHERE p.codigo = :user_activation_code";
$statement = $connect->prepare($query);
$statement->execu... | true |
ff0d604595d732751f98f4443b819fbf2daceee2 | PHP | 4d47/php-learning-experience | /tests/Language/OperatorsTest.php | UTF-8 | 1,053 | 2.765625 | 3 | [
"Unlicense"
] | permissive | <?php
class Language_OperatorsTest extends PHPUnit_Framework_TestCase
{
public function testShortenedTernary()
{
if (version_compare(PHP_VERSION, '5.3', '<')) {
$this->markTestSkipped('shortened ternary operator not available');
return;
}
$this->assertSame(42, ev... | true |
654809c6a5be184a43e95401addd7e7b714a5aeb | PHP | eclipseshadow/esdevlib | /halp/modules/halp_form_toolkit/classes/class-halp-form.php | UTF-8 | 17,387 | 2.84375 | 3 | [] | no_license | <?php
/**
* Halp Web Form Class
*
* - Responsible for the creation of the HTML <form> element
* - Provides methods for creating form field objects and storing them in the form object
* - Takes form field values from a Halp_Form_Handler and populates stored fields with values
* - Takes form field errors from a H... | true |
1e7707ec62406fa3c755739d133d7006c8e9b5cc | PHP | SergioCXT/PHP | /Tema2/Ejercicio15a.php | UTF-8 | 375 | 4.03125 | 4 | [] | no_license | <?php
// Realiza un procedimiento que reciba cinco números enteros como parámetros
// y muestre por pantalla el resultado de sumar los cinco números.
function sumaArray($valores){
$suma = 0;
for ($i=0; $i < count($valores) ; $i++) {
$suma = $suma + $valores[$i];
}
echo $suma;
}
$suma = sum... | true |
cd7e0bbeb0975501fb6d494d211e959074d30c52 | PHP | cpiehl/Project-Euler | /php/euler10.php | UTF-8 | 390 | 3.546875 | 4 | [] | no_license | #!/usr/bin/php
<?php
/* Project Euler #10
* Find the sum of all the primes below two million.
* Answer: 142913828922
*/
$MAX = 2000000;
$marked = str_repeat('f', $MAX);
$value = 3;
$s = 2;
while ($value < $MAX)
{
if ($marked[$value] == 'f')
{
$s += $value;
$i = $value;
while ($i < $MAX)
{
$marked[$i] =... | true |
11302ee1a2d7faf5ccbb609b133ea495819ed2ce | PHP | funkygao/fungame | /main/classes/Driver/GameDataFactory.php | UTF-8 | 1,311 | 3.125 | 3 | [] | no_license | <?php
namespace Driver;
// use SQLite for storage, publisher will push sqlite dbs to each php-fpm instance.
// each sqlite db is readonly, only for faster accessing expecially for bulk data filter
// TODO http://www.sqlite.org/whentouse.html
final class GameDataFactory {
/**
* @var \PDO
*/
private ... | true |
ff3ebb50c83be0372615c6a63a456aaa609b1ad0 | PHP | bakaphp/canvas-core | /src/Api/Controllers/SystemModulesController.php | UTF-8 | 1,273 | 2.515625 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace Canvas\Api\Controllers;
use Canvas\Models\SystemModules;
use Phalcon\Http\Response;
class SystemModulesController extends BaseController
{
/*
* fields we accept to create
*
* @var array
*/
protected $createFields = [
'name',
'slug'... | true |
7f0f253aecb26f9f2cbe0902ea5971b342f777cf | PHP | thaismartinsweb/vra-medtronic | /services/menu.php | UTF-8 | 2,152 | 2.890625 | 3 | [] | no_license | <?php
class Menu
{
public static function generateMenu()
{
$menu = '';
if(Menu::getAll())
{
foreach (Menu::getAll() as $name => $module)
{
$classes = (str_word_count($name) > 2) ? 'double-line' : '';
$classes .= (Menu::getCurrent... | true |
3d75929d5c7fe329739cf3584e6fa88e144a1350 | PHP | roopkanta-kumari/her-group | /web/library/Engine/Core/Base.php | UTF-8 | 471 | 2.859375 | 3 | [] | no_license | <?php
class Engine_Core_Base{
private static $_instance = null;
//Prevent any oustide instantiation of this class
private function __construct() {
}
private function __clone() { } //Prevent any copy of this object
public static function getInstance(){
if( !is_object(self::$_instance) ) //or if(... | true |
afd7d02c0f65ea09198134a2aa0f2c8874044c97 | PHP | KnpLabs/snappy | /src/Knp/Snappy/AbstractGenerator.php | UTF-8 | 19,838 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
namespace Knp\Snappy;
use Knp\Snappy\Exception\FileAlreadyExistsException;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use Symfony\Component\Process\Process;
use Exception;
use LogicException;
use RuntimeException;
use InvalidArgumentException;
/**
* Base generator class for medias.
*
* ... | true |
e1943981971b1f6f805d8dea22cfbafbc27038fb | PHP | yasirgit/hotmall | /protected/components/ViewsTrack.php | UTF-8 | 4,166 | 2.546875 | 3 | [] | no_license | <?php
class ViewsTrack {
public static function isDev() {
return (Yii::app()->db->username == 'supportc' ? true : false);
}
public static function addCategoryView($categoryId) {
ViewsTrack::registerView('p_view_categories', 'category_id', $categoryId);
}
public static function addSubCategoryView($categ... | true |
ff7f71235c1f775c644074c94aa489d77b313739 | PHP | OZOAR/CRCExchange | /app/Builders/Contracts/EndpointBuilderContract.php | UTF-8 | 588 | 2.765625 | 3 | [] | no_license | <?php
namespace App\Builders\Contracts;
use App\Builders\CPEndpointBuilder;
interface EndpointBuilderContract
{
/**
* Make root endpoint.
*/
public function root();
/**
* Make initial point with root endpoint.
*
* @return CPEndpointBuilder
*/
public static function poin... | true |
356c4e2d4e46958c02445dfefb4d884a13f7da14 | PHP | hacene1986/tp-list | /projet7/edit.php | UTF-8 | 1,449 | 2.515625 | 3 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min... | true |
0f14c37e073b1d7529b86760b15e19040620eeb9 | PHP | drblue/wcm18_php_oop_day6 | /party/app/Models/Guest.php | UTF-8 | 315 | 2.9375 | 3 | [] | no_license | <?php
class Guest {
protected $id;
protected $name;
protected $email;
protected $phone;
public function getId() {
return $this->id;
}
public function getName() {
return $this->name;
}
public function getEmail() {
return $this->email;
}
public function getPhone() {
return $this->phone;
}
}
| true |
f6616b8f3d1b42e5506e04cba34742a2fb12e530 | PHP | xaviranik/php-design-patterns | /strategy-pattern/src/AppLogger.php | UTF-8 | 208 | 2.734375 | 3 | [] | no_license | <?php
namespace App;
use App\Contracts\Logger;
use App\LogToFile;
class AppLogger
{
public function log($data, Logger $logger = null)
{
$logger = $logger ?: new LogToFile;
$logger->log($data);
}
} | true |
ed356220428caa20befb2791b5dce613e909acc0 | PHP | IraSkyx/news-feed | /DAL/Flux.php | UTF-8 | 523 | 3.265625 | 3 | [
"Apache-2.0"
] | permissive | <?php
class Flux {
private $id;
private $name;
private $link;
/**
* Flux constructor.
* @param $id
* @param $name
* @param $link
*/
public function __construct($id, $name, $link) {
$this->id = $id;
$this->name = $name;
$this->link = $link;
}
... | true |
c4a21dcad80c5d605658e7ad61040c4996b6c7f8 | PHP | movingfastball/o_basic | /7/sample7-1.php | UTF-8 | 314 | 2.9375 | 3 | [] | no_license | <?php
if('POST' == $_SERVER['REQUEST_METHOD']){
print "Hello,".$_POST['my_name'];
}else{
$page_header = <<<__HTML__
<form method = "POST" action = "$_SERVER[PHP_SELF]">
yourname:<input type="text" name="my_name">
<br>
<input type="submit" value="Say Hello">
</form>
__HTML__;
echo $page_header;
}
| true |
5186ec9e8fecc600ab57124833f7a25ae96d5101 | PHP | MBrauna/BPMS | /app/Http/Controllers/API/Admin.php | UTF-8 | 1,298 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace App\Http\Controllers\API;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use DB;
use Carbon\Carbon;
class Admin extends Controller
{
public function usuario(Request $request) {
$vDados = DB::table('users')
... | true |
3d100acbb83efb36ac9b3d1d6097c2fd4354fc7e | PHP | zblogcn/zblogphp | /zb_users/plugin/Totoro/inc/build_filterpunct.php | UTF-8 | 359 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
return 'filterpunct';
function filterpunct(&$content)
{
$regex = "/\~|\!|\@|\#|\\$|\%|\^|\&|\*|\(|\)|_|\\\|\\+|\||\-|\=|\||\{|\}|\[|\]|\;|\'|\:|\"|\<|\>|\?|\/|\.|\,|\!|\#|\¥|\…|\(|\)|\—|\、|\【|\】|\{|\}|\;|\:|\‘|\’|\“|\”|\《|\》|\\|\,|\。|\、|\?/si";
$content = preg_replace($regex, '', $content);
}
| true |
0f3b2737caadf9a5fbb1fce2dd2377bd8eebc293 | PHP | juanpablofuentes/PHP | /examen/Examen04.php | UTF-8 | 1,798 | 3.25 | 3 | [] | no_license | <?php
class Publicaciones {
protected $titulo;
protected $precio;
protected $paginas;
function __construct($titulo, $precio,$paginas){
$this->__set("titulo",$titulo);
$this->__set("precio",$precio);
$this->__set("paginas",$paginas);
}
function __get($name) {
i... | true |
6b95637094ae6ac66bc0ebb0f65beac3a6b4411d | PHP | workerJS/workerjs-phpclient | /src/WorkerJS/PHPClient/TaskMessageRouter.php | UTF-8 | 1,157 | 2.703125 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: miljanrakita
* Date: 12/13/18
* Time: 4:37 AM
*/
namespace WorkerJS\PHPClient;
class TaskMessageRouter {
private static $taskMessageRouter;
public static function getTaskMessageRouter() {
if(!self::$taskMessageRouter) {
self::$taskMessageRouter = new TaskMessageRo... | true |
f41dccdda6aab0fbb4e6f87f16bfb21f84986ebb | PHP | timdp/picard | /util/collect-data.php | UTF-8 | 1,647 | 2.765625 | 3 | [
"MIT"
] | permissive | <?php
/*
* PiCard
* Copyright (c) 2013 Tim De Pauw <http://timdp.github.com/>
* Released under the MIT License
*/
// DOCUMENTATION /////////////////////////////////////////////////////////////
// This utility parses all your Git repositories' commit logs and generates
// JSON data files in the forma... | true |
691818b31376f4ffdbdb545e8133cc4c6d2b1255 | PHP | presiyanbg/Transfermate | /views/site/libraryHTML/libraryList__php.php | UTF-8 | 2,240 | 2.875 | 3 | [] | no_license | <?php
$allBooks = [];
$searchedBooks = [];
if (is_array($data) && !empty($data)) {
if (count($data) > 2) {
$allBooks = $data;
$searchedBooks = $data;
} else {
$allBooks = $data[0];
$searchedBooks = $data[1];
}
}
/*
* Search author... | true |
b8bc9097c4127dcd5de44bd33a0999868bc91fb3 | PHP | luxueqi/phptest | /core/lib/class/Db.class.php | UTF-8 | 6,134 | 2.734375 | 3 | [] | no_license | <?php
if (!defined('EXITFORBID')) {
exit('forbid');
}
class Db {
private static $instance = null;
private $smt;
private $db;
private $table;
private $where = '';
private $preparedata = [];
private $colfield = '*';
private $isgetSql = false;
private static $conf;
private $islock = false;
private ... | true |
683595b5f47e09e01a36df96329cb9900c1561b2 | PHP | BiproBhowmik/Student-Management-System-By-Laravel | /app/Http/Controllers/BranchController.php | UTF-8 | 1,959 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Branch;
use DB;
class BranchController extends Controller
{
public function addBrPage()
{
return view('addBranch');
}
public function delBranch($id)
{
// $branch = Branch::find($id);
// $branch->delete();
DB::table('br... | true |
be1870a389ab9f281829285e192a2a18dadbce1a | PHP | kudejwiktor/code-challenge | /boats-service/src/Infrastructure/Persistence/Boat/BoatsRepository.php | UTF-8 | 1,897 | 2.890625 | 3 | [] | no_license | <?php
namespace Zizoo\BoatsService\Infrastructure\Persistence\Boat;
use Zizoo\BoatsService\Model\{
Boat,
BoatFactory,
BoatsCollection,
BoatsRepositoryInterface,
Query\Query
};
use Zizoo\BoatsService\Model\Exceptions\{
BoatException,
BoatNotFoundException
};
class BoatsRepository implement... | true |
47f8d93a3c081c56868f4e2bb6da10734f42040d | PHP | typo3-themes/themes | /Classes/ViewHelpers/Variable/SetViewHelper.php | UTF-8 | 4,026 | 2.75 | 3 | [] | no_license | <?php
namespace KayStrobach\Themes\ViewHelpers\Variable;
/*
* This file is part of the FluidTYPO3/Vhs project under GPLv2 or later.
*
* For the full copyright and license information, please read the
* LICENSE.md file that was distributed with this source code.
*/
use TYPO3\CMS\Extbase\Reflection\ObjectAccess;
u... | true |
0ff36b8efdab27ff0eaa1988a805bc3f76fb6d33 | PHP | ManishS6/CSE3002-OpenBookExam | /CLImodule4/ex3.php | UTF-8 | 210 | 2.90625 | 3 | [] | no_license | <?php
echo "This","string","was","made","with multiple arguments";
#print "This","string","was","made","with multiple arguments";
// 3rd line gives error because print can take only one argument unlike echo.
?> | true |
87f6adda74a6c8a95947686b505ddfcee44df5c6 | PHP | chendaye/Dragon | /Core/Lib/Registry/ApplicationHelper.php | UTF-8 | 2,886 | 2.59375 | 3 | [] | no_license | <?php
// +----------------------------------------------------------------------
// | DragonPHP [ DO IT NOW ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016-2017 http://chen.com All rights reserved.
// +------------------------------------------------------------... | true |
16df6fb6feec1af2f740afbce02521a3ab34af55 | PHP | anthonybieber/design_patterns | /src/Bridge/TestPage.php | UTF-8 | 781 | 2.546875 | 3 | [] | no_license | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<?php
function __autoload($className) {
include_once $className . '.php';
}
... | true |
ab0079ff345722dc4a79bf324c90241fce6abffb | PHP | bapasqualotto/Locadora | /valida_serie.php | UTF-8 | 421 | 2.515625 | 3 | [] | no_license | <?php
session_start();
include "conexao.php";
$result = mysqli_query($conn, "SELECT * FROM serie WHERE ".$_POST["serie"]." = cod_serie ");
while ($row = mysqli_fetch_assoc($result))
{
echo $row['cod_serie'];
echo "<br />";
echo $row['nome'];
echo "<br />";
echo $row['ano'];
echo "<br />";
echo $row['temporada... | true |
3a2f877544c2b05aeac13ac38281ecf75085831e | PHP | TYMathieu/hangman-gaame | /server/dbconnect.php | UTF-8 | 304 | 2.671875 | 3 | [] | no_license | <?php
try {
// connexion à la bdd
$connexion = new PDO(
'mysql:host=localhost:3306;dbname=pendu',
'root',
''
);
// Mettre les attributs
$connexion->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
} catch (Exception $e) {
echo $e->getMessage();
}
| true |
47820f9413b509807136daf6c91c3b21e3d3717e | PHP | rashidul-hasan/ecommerce-php-basic | /admin/scripts/upload_process.php | UTF-8 | 1,107 | 2.53125 | 3 | [] | no_license | <?php
require_once('dbconnect.php');
if(isset($_POST['submit'])){
// getting all the form data from POST superglobal
$title = $_POST['product_title'];
$price = $_POST['price'];
$category = $_POST['category'];
$brand = $_POST['brand'];
$description = $_POST['description'];
$keywords = $_POST['keyword... | true |
9d6ab1488a887544b0396c46c37a0d28187f7328 | PHP | villermen/runescape-lookup-commons | /src/HighScore/HighScoreEntryComparison.php | UTF-8 | 845 | 3.140625 | 3 | [
"MIT"
] | permissive | <?php
namespace Villermen\RuneScape\HighScore;
abstract class HighScoreEntryComparison
{
/** @var int|null */
protected $rankDifference;
protected function __construct(?HighScoreEntry $entry1, ?HighScoreEntry $entry2)
{
if (!$entry1 && !$entry2) {
throw new \InvalidArgumentExcepti... | true |
b2b270c779059db7f870447969ea0eabef8b1174 | PHP | Gormagrim/Projet-Seb | /controllers/inserParticularUserCtrl.php | UTF-8 | 12,712 | 3.015625 | 3 | [] | no_license | <?php
/*
* CONTROLLER de ma méthode "inserParticularUser()"
*
* je crée un tableau d'erreur vide, il permettra le stockage des différents messages d'erreurs de mon formulaire
*/
$formErrors = array();
/*
* Je stocke tout ce dont j'ai besoin pour ma méthode Ajax de recherche de ville dans le premier if
* Et je d... | true |
c33037573eca760bbedaf77bf88e8c46febea434 | PHP | adirkuhn/sarb | /tests/Unit/Plugins/PhpCodeSnifferFullResultsParser/internal/IssueLineParserStateTest.php | UTF-8 | 4,243 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace DaveLiddament\StaticAnalysisResultsBaseliner\Tests\Unit\Plugins\PhpCodeSnifferFullResultsParser\internal;
use DaveLiddament\StaticAnalysisResultsBaseliner\Domain\Common\FileName;
use DaveLiddament\StaticAnalysisResultsBaseliner\Domain\Common\LineNumber;
use DaveLiddament\Stat... | true |
2dd176c7a0e5e4c97f1f76da9d2be32cff47fee0 | PHP | ericmichaelroberts/signal | /Signal.php | UTF-8 | 1,419 | 2.71875 | 3 | [] | no_license | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Signal extends DMSA {
private static $TableChecked = false;
private static function InitTable(){
$ci =& get_instance();
return self::$TableChecked = !$ci->db->table_exists( 'signals' )
? $this->db->query(implode(' ',[
"... | true |
e66f910e8295dab035e8a346849e675378411d91 | PHP | duncan3dc/twitter | /src/Posts/Askfm.php | UTF-8 | 535 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace duncan3dc\Twitter\Posts;
class Askfm extends AbstractPost
{
public $hostname = "http://ask.fm";
public function __construct(array $row)
{
parent::__construct($row);
$this->username = $this->data["username"];
$this->fullname = $this->data["fullname"];
$this... | true |
ff78274aed73ea16cf0c5507ab6f2ea193766580 | PHP | c-urquhart/hons | /web/connection.php | UTF-8 | 287 | 2.6875 | 3 | [] | no_license | <?php
$host = "localhost";
$user = "root";
$password = "password";
$db = 'mysql';
// create connection string
$constr = new mysqli($host, $user, $password, $db);
// test connection
if ($constr->connect_error) {
die("Connection failed: " . $constr->connect_error);
}
?> | true |
9dbaa10a52f25d02bcf3b63f314f97960af4a877 | PHP | nih-fo/plugin-contacts | /Model/Behavior/ContactsFismaBehavior.php | UTF-8 | 992 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
class ContactsFismaBehavior extends ModelBehavior
{
public function Fisma_updateRecord(Model $Model, $record = [], $checkDiff = false)
{
/* Update the record in our table from Cerberus's record */
if(!$record)
return false;
$save = true;
$Model->create();
if(isset($record['id']) and $recor... | true |
32a796d383c97255f84b9e33488dd612526e15dd | PHP | asteph/Laravel_Blog | /app/models/Tag.php | UTF-8 | 303 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
class Tag extends Eloquent
{
protected $table = 'tags';
//allows many tags to be added at once
//laravel protects against pivot assignments being made in a loop
protected $fillable = array('name');
public function posts()
{
return $this->belongsToMany('Post', 'post_tag');
}
} | true |
772ee2789db9c8dcd5ef656c0513568e67dec427 | PHP | untera/php-patterns | /observer/Logger.php | UTF-8 | 259 | 3.0625 | 3 | [] | no_license | <?php
class Logger implements \SplObserver
{
private $events = [];
public function update(SplSubject $subject)
{
$this->events[] = "subject has changed!";
}
public function getEvents()
{
return $this->events;
}
} | true |
919f24cef96853e282bf4b304096f08d0a573a9b | PHP | fanlibang/pinduoduo | /src/Request/PddDdkGoodsUnitQuery.php | UTF-8 | 1,100 | 2.625 | 3 | [] | no_license | <?php
namespace pinduoduo\Request;
use pinduoduo\AbstractInterface\Request;
class PddDdkGoodsUnitQuery extends Request
{
/**
* 查询商品的推广计划
* @var string
*/
private $type = 'pdd.ddk.goods.unit.query';
/**
* 商品id
* @var
*/
private $goodsId;
/**
* 招商duoId
* @v... | true |
18537a5361dd5cd2b0889f22fe2f250d7d1c29c9 | PHP | damir-bubanovic/PHP-CodeBook | /ULTRA - FILES - writing to many filehandles simultaneously.php | UTF-8 | 1,197 | 3.53125 | 4 | [] | no_license | <?php
/*
!!FILES - WRITING TO MANY FILEHANDLES SIMULTANEOUSLY!!
> You want to send output to more than one filehandle
>> npr. you want to log messages to the screen and to a file
*is_array - finds whether a variable is an array
*is_null - finds whether a variable is NULL
*fwrite - binary-safe file write
... | true |
059b0b2fa4806b9c0d2a5cdc4323328f349442f5 | PHP | bayardev/rolling-log | /src/RollingLog/Serializer/ObjectSimplifierInterface.php | UTF-8 | 620 | 2.875 | 3 | [
"MIT",
"JSON"
] | permissive | <?php
namespace Bayard\RollingLog\Serializer;
interface ObjectSimplifierInterface
{
/**
* recovers a simple class name in doctrine class name
* @param String $classname doctrine class name
* @return String Simple class name
*/
public function getSimpleClassName($classname);
... | true |
d2355fad3117d523ae645b347bd915d6085e6515 | PHP | thalysonalexr/auth-oauth2 | /app/src/App/Domain/Handler/User/Create.php | UTF-8 | 1,364 | 2.671875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
declare(strict_types=1);
namespace App\Domain\Handler\User;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use App\Domain\Service\UserServiceInterface;
use App\Domain\Service\Exception\Us... | true |
b5b5e35dbc5aaa3628efbee707e6dcc59f5aef93 | PHP | guzzilar/omise-php-examples | /v3/transaction-v3.php | UTF-8 | 2,236 | 2.578125 | 3 | [] | no_license | <?php
// Implementation ---
$transactions = \Omise\Transaction::all([ 'limit' => 3, 'order' => 'reverse_chronological' ]);
// Template ---
Template::renderColumn(array(
'title' => 'Retrieve a collection of Transaction objects <small>(Total: ' . number_format(count($transactions)) . ' items)</small>',
'sl... | true |
3603b6088ef8d73e655505a5f6479eab6fd086d4 | PHP | mattmaynes2/Coursinator | /server/api/courses.php | UTF-8 | 2,296 | 2.796875 | 3 | [] | no_license | <?php
error_reporting(E_ALL);
require_once('lib/db.php');
require_once('lib/Course.php');
require_once('lib/CourseOffering.php');
switch ($_SERVER['REQUEST_METHOD']) {
case 'GET':
/** Query Courses
*
* Parameters:
* - code: Filter courses by the given code or prefix.
* Examples:
* /... | true |
1766a901cadd85c412f12f78e65b7e50119a5c37 | PHP | platformsh/admiral | /src/MessageHandler/BackupProductionHandler.php | UTF-8 | 2,035 | 2.625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
declare(strict_types=1);
namespace App\MessageHandler;
use App\Entity\Project;
use App\Message\BackupProduction;
use App\PlatformClient;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
/**
* Handler for backing up a project... | true |
a913e483e5d344ae3b1d9b95d9e77a62f773bf49 | PHP | markkimsal/libecomm | /src/lib/Lec/Txn/Manager.php | UTF-8 | 1,998 | 3.03125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/**
* The Transaction Manager is a pipeline of configurable plugins designed
* to operate on an order. For placing new orders you may have one
* pipe line, for refunding payments you may have another pipeline,
* for splitting orders to multiple shipments you may have yet
* another pipeline. You can als... | true |
daba889044382639e5cfda43ce3bcb7ee48f879a | PHP | liuzhihui6667/isophp | /Apps/Article/Handler/ArticleHandler.php | UTF-8 | 3,085 | 2.640625 | 3 | [] | no_license | <?php
/**
*
* @author ln6265431@163.com
* @date: 2018/1/13下午9:15
*/
namespace TopCms\Apps\Article\Handler;
use TopCms\Apps\Article\ArticleInfo;
use TopCms\Framework\Exceptions\ApiParamErrorException;
use TopCms\Framework\Mvc\Handler\BaseHandler;
/**
* Class ArticleHandler
*/
class ArticleHandler extends BaseHand... | true |
bfdde7bb2e6b04703216e9eeeaff8df878e916ee | PHP | chillerlan/php-threema | /tests/GatewayTest.php | UTF-8 | 3,862 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
/**
* Class GatewayTest
*
* @filesource GatewayTest.php
* @created 10.06.2017
* @package chillerlan\ThreemaTest
* @author Smiley <smiley@chillerlan.net>
* @copyright 2017 Smiley
* @license MIT
*/
namespace chillerlan\ThreemaTest;
use chillerlan\DotEnv\DotEnv;
use chillerlan\HT... | true |
80f7a8eecc0263e6a91622c19ce16355cc77a294 | PHP | anandsm08/phpmysqlworkshopiitb | /DAY1/Q3_matrix.php | UTF-8 | 271 | 3.609375 | 4 | [] | no_license | <?php
$a=array(array(2,3),
array(10,7));
$b=array(array(8,3),
array(4,3));
echo "Matrix Addition :","\n";
for($i=0;$i<2;$i++)
{
for($j=0;$j<2;$j++)
{
echo $a[$i][$j]+$b[$i][$j]." ";
}
echo "\n";
}
?> | true |
211868d7750882e9c262822a0ee9b6c1d49eb1bb | PHP | hoh-yue/Postgraduate_Management_System | /addSupervisor.php | UTF-8 | 3,992 | 2.65625 | 3 | [] | no_license | <?php
include "connect.php";
$supervisorName = $_GET["supervisorName"];
$supervisorPass = $_GET["supervisorPass"];
$supervisorContact = $_GET["supervisorContact"];
$supervisorEmail = $_GET["supervisorEmail"];
$supervisorFaculty = $_GET["supervisorFaculty"];
$supervisorRoom = $_GET["supervisorRoom"];
$... | true |
95a512be96cdce83bd136a0462006d487ca701d0 | PHP | Abhishek-Adhikari/WT-Assignment | /LAB07/Q1.php | UTF-8 | 386 | 2.71875 | 3 | [] | no_license | <!-- USE OF COOKIE
-->
<?php
setcookie('language', 'english');
?>
<?php
echo $_COOKIE['language'];
// english
?>
<!-- USE OF SESSION -->
<?php
session_start();
$_SESSION['user_id'] = 42;
echo $_SESSION['user_id'];
// 42
?>
<?php
// use both unset and destroy for compatibility
// with all browsers ... | true |
62118d3455104d9e19b8a935139ec78c2b694198 | PHP | artyRay12/Web-Labs | /lw3/inc/bubble_sort.inc.php | UTF-8 | 865 | 3.078125 | 3 | [] | no_license | <?php
function checkParametres()
{
if ((!isset($_GET['numbers']) || (count($_GET['numbers']) != 1))){
return false;
}
$arr = explode(",", $_GET['numbers']);
if (count($arr) == 1) {
return false;
}
if (!ctype_digit(join($arr))) {
return false;
}
... | true |
22fe0f97c601168225b8ff3dd3d55b59b09b868e | PHP | deyvisgc/storeBacken | /core/HistorialCaja/Infraestructura/AdapterBridge/DeleteHistorialCajaAdapter.php | UTF-8 | 729 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace Core\HistorialCaja\Infraestructura\AdapterBridge;
use Core\HistorialCaja\Application\UseCases\deleteHistorialCajaUseCase;
use Core\HistorialCaja\Infraestructura\DataBase\HistorialCajaRepositoryImpl;
class DeleteHistorialCajaAdapter
{
private HistorialCajaRepositoryImpl $historialCajaRepositoryI... | true |
857c4ff6244bc55cc28047f9341593648da59889 | PHP | robertoamoreno/client-php | /library/WPAPI/Users.php | UTF-8 | 2,874 | 3.015625 | 3 | [
"BSD-3-Clause",
"ISC"
] | permissive | <?php
/**
* Users collection
*
* @package WordPress API Client
* @subpackage Collections
*/
/**
* Users collection
*
* @package WordPress API Client
* @subpackage Collections
*/
class WPAPI_Users implements WPAPI_Collection {
/**
* API object
*
* @var WPAPI
*/
protected $api;
/**
* Constructor... | true |
b61654e2671c8dd1776f997fe2e8e91ae5f65c39 | PHP | lordtatty/bluego | /libs/bluegocore/src/loaders/views/UserCourseViewLoader.php | UTF-8 | 786 | 2.671875 | 3 | [] | no_license | <?php
namespace BlueGoCore\Loaders\Views;
use BlueGoCore\Models\IModelConcrete;
use BlueGoCore\Models\User;
use BlueGoCore\Models\Views\UserCourseView;
class UserCourseViewLoader extends ViewLoaderAbstract {
/**
* @param $id
* @return \BlueGoCore\Models\Views\UserCourseView|null
*/
public func... | true |
db71236a49ac7249b0e90a44395159d914e32e3f | PHP | suyin12/jh-framword | /php/toString魔术方法.php | UTF-8 | 292 | 3.5625 | 4 | [] | no_license | <?php
class Test{
private $name;
function __construct($name){
$this->name = $name;
}
function __toString(){
return '名称:'.$this->name;
}
function say(){
echo $this->name;
}
}
$test = new Test('粟建晖');
echo $test;
//$test->say(); | true |
d490af04d418d75470c1e8e043f2c7e4d41b7774 | PHP | web-token/jwt-framework | /src/Component/Core/JWK.php | UTF-8 | 3,334 | 2.953125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Jose\Component\Core;
use function array_key_exists;
use function in_array;
use InvalidArgumentException;
use function is_array;
use const JSON_THROW_ON_ERROR;
use const JSON_UNESCAPED_SLASHES;
use const JSON_UNESCAPED_UNICODE;
use JsonSerializable;
use ParagonIE\ConstantTime\... | true |
70e1c3e5e9f8f6776b13dd6c9aefdb499ef63bbc | PHP | banda13/Visszersebesz | /api/utils.php | UTF-8 | 348 | 3.140625 | 3 | [] | no_license | <?php
function startsWith($haystack, $needle)
{
return substr_compare($haystack, $needle, 0, strlen($needle)) === 0;
}
function endsWith($haystack, $needle)
{
return substr_compare($haystack, $needle, -strlen($needle)) === 0;
}
function getHtmlElementByID($xpath,$id)
{
$elements = $xpath->getElementById($... | true |
75435a928951043e96f06f84d6065d335a419bee | PHP | Kunstmaan/KunstmaanBundlesCMS | /src/Kunstmaan/GeneratorBundle/Helper/GeneratorUtils.php | UTF-8 | 4,935 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace Kunstmaan\GeneratorBundle\Helper;
use Doctrine\ORM\Mapping\ClassMetadata;
use Sensio\Bundle\GeneratorBundle\Command\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\DependencyInjection\ContainerInterf... | true |
3c9f31071a3f9f9914c2b4fc6ea8aa93c14480cb | PHP | JimTR/PHPgsm | /xpaw/SourceQuery/Socket.php | UTF-8 | 2,152 | 2.703125 | 3 | [
"LGPL-2.1-or-later",
"MIT"
] | permissive | <?php
/**
* @author Pavel Djundik
*
* @link https://xpaw.me
* @link https://github.com/xPaw/PHP-Source-Query
*
* @license GNU Lesser General Public License, version 2.1
*
* @internal
*/
namespace xPaw\SourceQuery;
use xPaw\SourceQuery\Exception\InvalidPacketException;
use xPaw\SourceQuery\Excep... | true |
666991e713055f3b9ed740014c66f4ac23c75005 | PHP | inunosinsi/soycms | /cms/common/action/site/Plugin/PluginListAction.class.php | UTF-8 | 587 | 2.546875 | 3 | [] | no_license | <?php
class PluginListAction extends SOY2Action{
private $state;
function setState($state){
$this->state = $state;
}
function execute() {
$dao = SOY2DAOFactory::create("cms.PluginDAO");
try{
if(is_null($this->state)){
$plugins = $dao->get();
}else if($this->state){
... | true |
ecc8a00b199e59b83ea5bca9a617f58f0897b36c | PHP | shixiaojun90/yafcms_admin_web | /application/library/core/Rsa.php | UTF-8 | 1,901 | 2.96875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: hezhi
* Date: 2017/9/18
* Time: 下午4:57
*/
class Rsa {
//私匙
private $privKey = '-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQCeKO6lgAgQNBdETRG36H+Nzf/QyxmrbCCfT5nGR2rSnqW7Aw/4
/10CREDO7AznkAnPv+kh189nppXKNLdEg30GonelhUKVAPWRSdl9/vp6eXlpc6mH
juitfWplxTnSXPVdrJWTWV7Q... | true |
bfc35057b6ce966e9ac7328d4f1a81a8a3bbf2ee | PHP | cmooony/d4d-studio | /branches/php/demo/plugin/modifier.highlight.php | UTF-8 | 665 | 2.625 | 3 | [] | no_license | <?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
* @author peter@jiwai.com
*/
/**
* 权限控制判断
*
* Type: modifier<br>
* Input: access_ids
* Example: {$access_ids|$access}
* @version 1.0
* @param (String) $access_id | 权限id
* @return String true or false
*/
functi... | true |
dbd459d1d7f704fe476502519a31fd0ef5b292f8 | PHP | Sam-Daniel/forum-6 | /topics.php | UTF-8 | 4,082 | 2.71875 | 3 | [] | no_license | <?php
session_start();
include './db.php';
if (isset($_SESSION['user'])) {
$_SESSION['user']['username'] .
'<a href="logout.php">Log Out</a>';
} else {
header('location: login.php');
}
$user = $_SESSION['user'];
if (isset($_GET['id'])) {
$id = $_GET['id'];
$sql_delete =... | true |
18cebab5b66090869acc1cc7c3e92a19ca264726 | PHP | Hazhir007/Exchange | /app/Domain/Money/MoneyInterface.php | UTF-8 | 466 | 3.140625 | 3 | [] | no_license | <?php
namespace App\Domain\Money;
use App\Domain\Currency\CurrencyInterface;
interface MoneyInterface
{
public function setAmount(int $amount, ?string $from = null);
public function getAmount(): int;
public function subtract(int $amount);
public function add(int $amount);
public function se... | true |
b4dc11fb0aedfbb6aa601f3c8a402f3bad60c1d8 | PHP | meneguetti/viscle | /src/Renderer.php | UTF-8 | 394 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
namespace Viscle;
/**
* Description of Renderer
*
* @author Vitor Meneguetti
*/
class Renderer
{
/**
* Generate HTML, with the visual lifecycle, through json parsed data
*
* @param string $data
* @return string
*/
public function render(string $data)
{
ob_start... | true |
b60806d77ae678e0922df0b85c4630744f266fa6 | PHP | AC41004-Team11/yoyo-industrial-project | /app/User.php | UTF-8 | 3,995 | 2.59375 | 3 | [] | no_license | <?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name',
'... | true |
63726e7a34f45431d94e8c898a7be401a6dac2f6 | PHP | arui0609/alasite-helper | /src/Models/Relationship.php | UTF-8 | 1,243 | 2.59375 | 3 | [] | no_license | <?php
namespace Arui\AlaSite\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class Relationship extends Model
{
protected $table = "relationships";
public $timestamps = false;
public static function getItemID ($relationship_type,$target_type,$target_id){
$wh... | true |
c959a5e5efc3b0641e9f5f956b777911f01b9143 | PHP | snigdho991/php_oop_concepts | /PDO [ALL]/index(bind(),PDO-Prepared).php | UTF-8 | 1,000 | 3 | 3 | [] | no_license | <?php
include 'inc/header.php';
?>
<?php
$dsn = "mysql:dbname=userdata; host=localhost;";
$user = "root";
$pass = "";
try {
$pdo = new PDO($dsn, $user, $pass);
} catch (PDOException $e) {
echo "Connection Failed !".$e->getMessage();
}
$id = "36";
$name = "Mr. Kamran";
$email = "Kamran@hotmai... | true |