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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
96ebd8e71318c368ecc83d3521422fc3e9ae4ba5 | PHP | cfranco92/blog_RSForum | /app/Post.php | UTF-8 | 2,124 | 2.640625 | 3 | [] | no_license | <?php
// Developed by Cristian Franco Bedoya
namespace App;
use Cviebrock\EloquentSluggable\Sluggable;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
use Sluggable;
protected $fillable = [
'title', 'body', 'iframe', 'image', 'user_id'
];
/**
* Return the sluggable co... | true |
17fead4fa0d74780d0aa44f0d775d89ca45bb106 | PHP | naim-lasker/furniture-e-commerce | /brothersfurniture/showrooms.php | UTF-8 | 1,289 | 2.5625 | 3 | [] | no_license | <?php
require_once("db.php");
$query = "select * from showroom";
$result = mysqli_query($db_con, $query);
?>
<!DOCTYPE html>
<html>
<head>
<title>showrooms</title>
<link rel="stylesheet" type="text/css" href="style_showrooms.css">
</head>
<body>
<div class="whole">
<header>
<a class="hea... | true |
cbfe0277ead08c33ceafba26bc8cc832fd3823fe | PHP | tsukikoko/HackerRank | /Practice/Warmup/Time_Conversion/Time_Conversion.php | UTF-8 | 772 | 3.28125 | 3 | [] | no_license | <?php
/*
* Complete the timeConversion function below.
*/
function timeConversion($s) {
/*
* Write your code here.
*/
$tim = "";
$arr = preg_split("/[:]/",$s);
if( preg_match( '/AM$/', $arr[2]) ) {
$replace = str_replace('AM', '', $arr[2]);
if($arr[0] === "12"){
$arr[0]... | true |
b9614e8db3abe54b789180941bf80d5f1b685db7 | PHP | AntoineLemaire/ImageMerge | /test/UnitTest/Utils/GeometryUtilsTest.php | UTF-8 | 7,161 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace Jackal\ImageMerge\Test\UnitTest\Utils;
use Jackal\ImageMerge\Command\Options\MultiCoordinateCommandOption;
use Jackal\ImageMerge\Utils\GeometryUtils;
use Jackal\ImageMerge\ValueObject\Coordinate;
use PHPUnit\Framework\TestCase;
class GeometryUtilsTest extends TestCase
{
public function testCock... | true |
6170a5eda00311359ffd1c9ab611c229a0040bf3 | PHP | babirondo/api | /classes/class_db.php | UTF-8 | 1,643 | 2.90625 | 3 | [] | no_license | <?php
class db
{
function conecta()
{
$localhost = "localhost";
$db ="pb";
$username = "postgres";
$password = "rodr1gues";
try {
$this->pdo = new PDO("pgsql:host=$localhost;dbname=$db", $username, $password);
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} ... | true |
3a5aefe15f11beb75915cc7289c5f9ca044d0ad9 | PHP | amit131/laravel | /app/database/migrations/2014_11_10_063341_create_shop_product_variation_table.php | UTF-8 | 723 | 2.53125 | 3 | [] | no_license | <?php
use Illuminate\Database\Migrations\Migration;
class CreateShopproductvariationTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('shop_product_variation', function($table) {
$table->increments('id');
... | true |
cfee61cbdb8556322f2fd04970613cc42dad2bfe | PHP | Rodrigmen/LoginLogoffTema5 | /scriptDB/cargar.php | UTF-8 | 2,997 | 2.921875 | 3 | [
"MIT"
] | permissive | <?php
/**
* Script de carga
*
* @version 1.0.0
* @since 26-11-2020
* @author Rodrigo Robles <rodrigo.robmin@educa.jcyl.es>
*/
require_once "../config/confDB.php"; //Incluimos el archivo confDBPDO.php para poder acceder al valor de las constantes de los distintos valores de la conexión
try {
$miDB = new PDO... | true |
6d4ef0737232194b64896f6d69c1ba1f0c231a74 | PHP | amfo/hlinking | /app/System/Control.php | UTF-8 | 790 | 2.609375 | 3 | [] | no_license | <?php
namespace system;
class Control
{
public static function show404() {
header('Content-Type: text/html; charset=UTF-8');
header("Status: 404 Not Found", true, 404);
include ROOT . '/views/404.phtml';
exit;
}
public static function forbidden() {
header('Content-Type: text/html; charset=UTF-8');
hea... | true |
285a20c1655dfa6ac2379f5b5d70d150e7aaa2df | PHP | ricardosierra/translation | /src/Observers/Localize.php | UTF-8 | 4,869 | 2.53125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
namespace Translation\Observers;
use Translation\Models\Element;
use Translation\Models\Translation as TranslationModel;
use Config;
use Illuminate\Support\Str;
use Event;
use Log;
use Symfony\Component\Debug\Exception\FatalThrowableError;
use Throwable;
use Illuminate\Support\Facades\Schema;
use Auth;
use Tran... | true |
d80d19708c62a2130f95d68e46a571f8e8aa8a32 | PHP | XenosEleatikos/MusicBrainz | /src/Filter/Property/SortNameTrait.php | UTF-8 | 610 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
namespace MusicBrainz\Filter\Property;
use AskLucy\Expression\Clause\Phrase;
use MusicBrainz\Value\Name;
trait SortNameTrait
{
use AbstractAdderTrait;
/**
* Returns the field name for the sort name.
*
* @return string
*/
public static function sortName(): string
{
r... | true |
76052a6bce66b8d78405900bd4e2b67185936e68 | PHP | kei-ichimura/posts | /post3102/index.php | UTF-8 | 1,030 | 3.296875 | 3 | [] | no_license | <?php
$cn = $_POST['convertNewline'] ?? '';
$rn = $_POST['removeNewline'] ?? '';
if ($cn || $rn) {
$cn_after = convertNewline($cn);
$rn_after = removeNewline($rn);
echo '<p>改行変換 : ', $cn_after, ' / 変換前16進表現 : ', bin2hex($cn), '/ 変換後16進表現 : ', bin2hex($cn_after), '</p>';
echo '<p>改行削除 : ', $rn_after, ... | true |
7ba4b86a419eb55de675de58e0eb899663f2cb0d | PHP | cark1/_gateres | /core/Controller.php | UTF-8 | 1,448 | 2.953125 | 3 | [
"MIT"
] | permissive | <?php
namespace gateres\core;
class Controller{
protected $request;
protected $response;
function __construct($_request,$_response){
$this->request = $_request;
$this->response = $_response;
}//__construct
protected function getUrlParam($_paramName){
if(isset($this->request->urlParams[$_pa... | true |
4b0a59ad28cdda2ce03a0b8f8cbb47a37f049c78 | PHP | Brightwell-Dlamini/Vijina-s-Spa | /includes/functions.php | UTF-8 | 1,186 | 2.71875 | 3 | [] | no_license | <?php
function redirectTo($newLocation){
header("Location:".$newLocation);
exit;
}
function checkUsernameExistence($userName)
{
global $connectingDB;
$sql = "SELECT username FROM users WHERE username = :userName";
$stmt = $connectingDB->prepare($sql);
$stmt->bind_param('s', $userName);
... | true |
d99f11b71b884f29c209ba90f4ac113b99b6a714 | PHP | LeeLee-00/Caesar-cipher-PS9 | /caesar.php | UTF-8 | 4,068 | 3.359375 | 3 | [] | no_license | #!/usr/bin/php -d display_errors
<?php
class Caesar {
public static $numbersToLetters = array(
0 => 'A',
1 => 'B',
2 => 'C',
3 => 'D',
4 => 'E',
5 => 'F',
6 => 'G',
7 => 'H',
8 => 'I',
9 => 'J',
10 => 'K',
11 => 'L',
12 => 'M',
13 => 'N',
14 => 'O',
15 => 'P',
16 => 'Q',
17 => 'R',
18 =>... | true |
1a646da1f888c741685e29241b4c37f96a8155f7 | PHP | LukaszK88/Battle-Heritage-Sport-Ranking | /app/core/Errors.php | UTF-8 | 749 | 3.015625 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: Lukasz
* Date: 20/09/2016
* Time: 17:59
*/
namespace Battleheritage\core;
class Errors{
public static $_errors = [];
public static function addError($error){
self::$_errors[] = $error;
}
public static function errorMsg($id,$parmArray = array()){... | true |
b6abd7bd12a432dae43c8b2b91bb66be8ba3bb03 | PHP | stanisurav/Web_site | /WWW/lab2/lab_2_6_1.php | UTF-8 | 928 | 3.5 | 4 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<title>Короленко</title>
</head>
<body>
<img src="1.png">
<?php
echo '<br/>';
$a = rand(-20,20);
$b = rand(-20,20);
echo 'Первое число: ' . $a . '<br/>';
echo 'Второе число: ' . $b;
// вторая часть первого условия
$t1 = $b*$b + $a;
$F = array(2);
for ($i=0; $i < 2; $i++) {
//1
if ($... | true |
b993c14b1540e01e0fc0c0b386d4354205aa497e | PHP | Acessef/MaterialsSub | /laravel/app/Http/Controllers/ApiController.php | UTF-8 | 7,507 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use App\book080703;
use App\HadBooked;
use App\Major;
use Illuminate\Http\Request;
use PhpParser\Node\Scalar\String_;
class ApiController extends Controller
{
//
public function getMajor(){
$major = new Major();
$data = $major::all();
return respo... | true |
2c14e1f6ab5b4c08a57b82924d5a3a00cf1d26e3 | PHP | amoravski/training-projects | /amoravski-wordpress/get_json.php | UTF-8 | 1,988 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | <?php
require("cred.php");
foreach ($countries as $country) {
//Gets me decoded json
$json = file_get_contents("http://api.geonames.org/searchJSON?username=ksuhiyp&country=$country&maxRows=1000");
$decoded_json = json_decode($json, true)['geonames'];
// Opens a connection to a MySQL server
$conne... | true |
4024f7bf40f26cde52364224854eb1bba7b56dd6 | PHP | LiLong112233/MyFistGith | /test/PHP3object-oriented/11-16/phone/phone.php | UTF-8 | 2,984 | 2.546875 | 3 | [] | no_license | <?php
include('../../demo/DB.class.php');
$db=new DB();
$res=$db->findAll('phonebrand');
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<form action="phonedo.php" method="post" onsubmit="return check_submit()">
<table border="1">
<tr>
<td>商品名称</td>... | true |
0872ddc5d93ed6d1dc3811933c544a18dfb4e8e3 | PHP | Lab411bkhn/rbi | /App/Controller/home/equipmentController.php | UTF-8 | 8,090 | 2.546875 | 3 | [] | no_license | <?php
require_once '../../Model/libraries/excel_reader.php';
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of equipmentController
*
* @author Dương
*/
ob_sta... | true |
970520c1eb8196c8417eecef6f4f68f7bb027498 | PHP | alignalghii/student-administration-framework | /app/Utility/DateUtil.php | UTF-8 | 237 | 2.921875 | 3 | [] | no_license | <?php
namespace Utility;
class Dateutil
{
public static function isValid($rawDate)
{
try {
$date = new \DateTime($rawDate);
$status = !empty($date);
} catch (\Exception $e) {
$status = false;
}
return $status;
}
}
| true |
4cbbadf8f661b95050a35f76594326866247a45d | PHP | aurora-php/php-lua | /tests/006.phpt | UTF-8 | 711 | 2.5625 | 3 | [] | no_license | --TEST--
Lua::include()
--SKIPIF--
<?php if (!extension_loaded("lua")) print "skip"; ?>
--FILE--
<?php
$filename = __FILE__.'.tmp';
$code = array(
'fine' => 'print "Hello PHP"',
'broken' => 'dgdr fdrg erb rxdgre tews< df hxfdxgfc gsdgxvrsgrg.ve4w',
'return' => 'return "php", "lua", "extension"',
);
$l = new... | true |
43f41b4321d8e24f3181032b3c27f840ee4d5369 | PHP | undercloud/lang | /Parser/DefaultParser.php | UTF-8 | 405 | 2.734375 | 3 | [] | no_license | <?php
namespace Undercloud\Lang\Parser;
use Exception;
class DefaultParser extends AbstractParser
{
public function parse()
{
$path = func_get_arg(0) . '.php';
if (file_exists($path)) {
if (@is_readable($path)) {
return require($path);
} else {
throw new Exception(
sprintf('Cann... | true |
0ad284810c8da63ade80af83fc4de054459b5958 | PHP | chufucheng/blog | /app/Tools/Fun.php | UTF-8 | 4,556 | 3.09375 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: cpx
* Date: 2017/11/10
* Time: 10:29
*/
class Fun{
//去除空格
public static function array_trim($array,$replace = false, $from =',',$to = ''){
if($replace){
array_walk_recursive($array, function(&$item)use($from,$to){
$str = str_repla... | true |
24dd2021e495ebec0f9c31ba09309302d8af346a | PHP | chrisdavenport/DQuery | /libraries/dquery/clauses/table.php | UTF-8 | 2,256 | 2.859375 | 3 | [] | no_license | <?php
/**
* @version $Id: $
* @package DQuery
* @copyright Copyright (C) 2010 Davenport Technology Services. All rights reserved.
* @license GNU/GPL version 2 or later.
*/
// Check to ensure this file is being called from within the Joomla Framework.
defined( 'JPATH_BASE' ) or die();
jimport( 'dquery.clause' );
/... | true |
64d2a1a74ec6beadecaef7adaf7512694b4598d0 | PHP | shhr1214/aoj | /php/getting_started/insertion_sort.php | UTF-8 | 274 | 3.125 | 3 | [] | no_license | <?php
$N = trim(fgets(STDIN));
$line = trim(fgets(STDIN));
$A = explode(' ', $line);
for ($i = 1; $i < $N; $i++) {
$key = $A[$i];
$j = $i - 1;
while ($j >= 0 && $A[$j] > $key) {
$A[$j + 1] = $A[$j];
$j--;
}
$A[$j + 1] = $key;
echo implode(' ', $A), PHP_EOL;
} | true |
35780970223fb2cd4c949700ec7508d776f3759c | PHP | nailfor/leaflet | /src/Leaflet.php | UTF-8 | 3,679 | 2.65625 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
/**
* Copyright (c) 2019.
* @author nailfor
*/
namespace nailfor\leaflet;
use Illuminate\Contracts\Support\Htmlable;
class Leaflet extends baseModel implements Htmlable
{
use htmlClass;
/**
* Latitude of start position
*
* @var float
*/
protected $Lat;
/**
* Lo... | true |
e9e0d73e0e746db201063da409914e55cc4a1bba | PHP | afradbhuiyan/lobster | /app/controllers/accounts.php | UTF-8 | 5,987 | 2.671875 | 3 | [] | no_license | <?php
class accounts extends controller{
//store the config class object
private $config;
//store the functions class object
private $functions;
//store all the required model's object
private $model_objs=array();
//store al... | true |
4904b9fde0ce7415cce5a53d735448305c3f1535 | PHP | Reviewver/markJob | /Vue/menu.php | UTF-8 | 2,438 | 2.890625 | 3 | [] | no_license | <?php
class Menu
{
// Liste des noms des boutons
private $_nameListe = array();
private $_urlListe = array();
private $_subcategorie = array();
private $_sub = 0;
private function _button($name, $url)
{
?>
<a class="btn btn-dark" href="<?php echo $url ?>"><?php echo $name ?></a>
<?php
}
private function _startDrop... | true |
6f467905c77bc18e86f179faf756e0e4fa3afcb5 | PHP | Millon15/php_piscine | /d06/ex02/Vertex.class.php | UTF-8 | 1,355 | 3.375 | 3 | [] | no_license | <?php
require_once 'Color.class.php';
class Vertex {
public static $verbose = false;
public static function doc()
{
return file_get_contents('Vertex.doc.txt');
}
private $_x;
private $_y;
private $_z;
private $_w;
private $_color;
public function __construct( $arr )
{
$this->_x = $arr... | true |
93fd85670fc2a374c37ba63657ced300d27531c9 | PHP | fsanchez17/m8git | /controllers/saveUser.php | UTF-8 | 1,233 | 2.546875 | 3 | [] | no_license | <?php
include_once '../classes/db.class.php';
//$salt ='$belda&';
if(isset($_POST)){
$db = new db();
$control = 0;
if($_POST['password_new'] != ""){
if($_POST['password_new'] == $_POST['password_new2']){
$password_old = $db->getActualPass();
//echo json_encode($password_old, array($_POST['password_old']))... | true |
c8983e6484df324dc75e481b42ff6b3f7fe8720d | PHP | spujadas/exposure | /data/import_sponsor_return_types.php | UTF-8 | 1,639 | 2.875 | 3 | [
"MIT",
"Apache-2.0",
"LicenseRef-scancode-public-domain"
] | permissive | <?php
/*
* This file is part of the Exposure package.
*
* Copyright 2013 by Sébastien Pujadas
*
* For the full copyright and licence information, please view the LICENCE
* file that was distributed with this source code.
*/
/*
* Imports sponsor return types from TSV file
*
* SYNTAX
* php import_sponsor_re... | true |
6a7a4006f9596f1e40b8da3b0763a59d84613988 | PHP | giezele/PHPComposer-Doctrine | /src/models/User.php | UTF-8 | 508 | 2.8125 | 3 | [] | no_license | <?php
namespace Models;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="users")
*/
class User
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Address")
* @ORM\JoinColumn(name="... | true |
576dc25f031bf2bd51f0827e015dec34e5cf15ad | PHP | buckaroo-it/Magento2 | /Service/Formatter/Address/PhoneFormatter.php | UTF-8 | 5,622 | 2.6875 | 3 | [
"LicenseRef-scancode-free-unknown",
"MIT"
] | permissive | <?php
/**
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License
* It is available through the world-wide-web at this URL:
* https://tldrlegal.com/license/mit-license
* If you are unable to obtain it through the world-wide-web, please send an email
* to support@buckaroo.nl so we can send you a co... | true |
b14fac9c538010862d9849f67bc65b49c511ae56 | PHP | 50sq/commerce-channels | /src/Drivers/Clients/Shopify/ShopifyClient.php | UTF-8 | 739 | 2.8125 | 3 | [
"MIT"
] | permissive | <?php
namespace FiftySq\Commerce\Channels\Drivers\Clients\Shopify;
use FiftySq\Commerce\Channels\Drivers\Clients\AbstractClient;
abstract class ShopifyClient extends AbstractClient
{
protected string $shop;
protected string $key;
protected string $password;
protected string $version;
/**
* ... | true |
011cabaec8efbd85224fb0f54230635386f14cf4 | PHP | MrAizakku/CST126Milestone | /comment.php | UTF-8 | 3,653 | 2.65625 | 3 | [] | no_license | <?php
session_start();
require('myfuncs.php');
if (!isset($_SESSION['USERNAME'])) {
header('Location: login.html');
exit;
}
require_once 'header.php';
?>
<script>
function ConfirmDelete()
{
return confirm("Are you sure you want to delete?");
}
</script>
<?php
$blogid = $_GET["blogid"];
$user... | true |
23ae7066c62dd96073b1877e211aae519c3bfefb | PHP | Vasterra/public-projects | /Financial calculator/app/Services/Master.php | UTF-8 | 3,336 | 2.765625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Services;
class Master {
public function getoptions( $arr = [], $value = 'key', $text = 'value', $start = null, $selected = null ) {
$options = '';
if($start) {
$options .= '<option value="">'.$start.'</option>';
}
foreach ($arr as $key => $_item) {
$option_selected = '';
$o... | true |
83f8ced781b67a1db1416a65fc7a79e0bda76e38 | PHP | EduIsfun/Tribal-dashboard | /new/teacher/admindashboard/teacherresult.php | UTF-8 | 5,270 | 2.6875 | 3 | [] | no_license | <?php
session_start();
include('db_config.php');
include('model/Teacher.class.php');
global $conn;
$teacher = new Teacher();
$html = " ";
/* echo $query = "SELECT * FROM user";
$results = mysqli_query($conn, $query);
while ($row = mysqli_fetch_assoc($results) ){
echo 'Name => '. $row['name'];
} */
i... | true |
e92fde128f78d9157bdbee6c84256c243edf666c | PHP | dreimalbla/dc-general | /src/ContaoCommunityAlliance/DcGeneral/Controller/Ajax.php | UTF-8 | 6,095 | 2.546875 | 3 | [] | no_license | <?php
/**
* PHP version 5
* @package generalDriver
* @author Christian Schiffler <c.schiffler@cyberspectrum.de>
* @author Stefan Heimes <stefan_heimes@hotmail.com>
* @author Tristan Lins <tristan.lins@bit3.de>
* @copyright The MetaModels team.
* @license LGPL.
* @filesource
*/
namespace Con... | true |
ee92ef7c14e8660a03df7aea28e6a48b39305387 | PHP | valeriucernei/carmarket | /api/config.php | UTF-8 | 1,949 | 2.578125 | 3 | [] | no_license | <?php
/**
* Config class
*
*/
class Config {
const DATA_FORMAT = "Y-m-d H:i:s";
/* Data Base Settings */
public static function DB_HOST() {
return Config::get_env("DB_HOST", "localhost");
}
public static function DB_USERNAME() {
return Config::get_env("DB_USERNAME", "carmarket")... | true |
27fbaa331f0ad50c73fddae185371d9f2c93f1e3 | PHP | ziyaadm/zlickDeals | /server/api/orders.php | UTF-8 | 1,597 | 2.828125 | 3 | [] | no_license | <?php
$link = get_db_link();
if ($request['method'] === 'POST') {
$cartIDReturned = getCart();
$bodyReturned = getBody($request);
$placeOrderReturned = placeOrder($cartIDReturned, $bodyReturned, $link);
$response['body'] = $placeOrderReturned;
send($response);
}
function getCart (){
if (isset($_SESSION['... | true |
c80c170574007298a906d1c031db91843c767b15 | PHP | MatteoVollero/php-oop-1 | /index.php | UTF-8 | 1,811 | 3.1875 | 3 | [] | no_license | <?php
// definisco la classe User
class User
{
public $nome;
public $cognome;
private $codiceFiscale;
// Costruttore parametrizzato
function __construct($nome,$cognome,$codiceFiscale)
{
$this->nome = $nome;
$this->cognome = $cognome;
$this->codiceFiscale = $codiceFiscal... | true |
870c58dffed93b59d45e7f95b0550fa09c79a65a | PHP | edertone/TurboDepot | /TurboDepot-Php/src/test/php/managers/LogsManagerTest.php | UTF-8 | 7,416 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | <?php
/**
* TurboDepot is a general purpose multi storage library (ORM, Logs, Users, Files, Objects)
*
* Website : -> https://turboframework.org/en/libs/turbodepot
* License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
* License Url : -> htt... | true |
33c9d298556dd18817a52cfffb12f5cf5a24a696 | PHP | lucas-s-avila/is2med-api | /views/AppView.php | UTF-8 | 2,633 | 2.734375 | 3 | [] | no_license | <?php
require_once("../controller/AppDB.php");
$request_method=$_SERVER["REQUEST_METHOD"];
switch($request_method) {
case 'GET':
if(!empty($_GET["id"])) {
$id=$_GET["id"];
getAppoint($id);
}
elseif (!empty($_GET["date"]) or !empty($_GET["doctorid"]) or !empty($_GET... | true |
427d297142277f03ab74a41165f2a042af53c46a | PHP | roeltz/pipa-data-mongodb | /src/Pipa/Data/Source/MongoDB/MongoDBAggregateBuilder.php | UTF-8 | 2,478 | 2.546875 | 3 | [] | no_license | <?php
namespace Pipa\Data\Source\MongoDB;
use MongoCode;
use Pipa\Data\Criteria;
use Pipa\Data\Aggregate;
class MongoDBAggregateBuilder {
function build(Aggregate $aggregate) {
switch($aggregate->operation) {
case Aggregate::OPERATION_SUM:
$mapfn = new MongoCode(
<<<MAP
function() {
var value = this.... | true |
51ecefe1ba87507fe37b5fe88c1f1f64d472430f | PHP | Reconceptus/arplans | /modules/shop/models/ItemImage.php | UTF-8 | 3,029 | 2.609375 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace modules\shop\models;
/**
* This is the model class for table "shop_item_image".
*
* @property string $id
* @property int $item_id
* @property int $type
* @property string $image
* @property string $alt
* @property string $thumb
*
* @property Item $item
*/
class ItemImage extends \yii\db\Act... | true |
7dbd12212b2a591fd6f2c85b129b02310d93ad31 | PHP | aquinzi/goi-admin | /user-session.php | UTF-8 | 1,426 | 2.640625 | 3 | [] | no_license | <?php
namespace WordAdmin\Login;
require_once $_project_dir.'/loader.php';
function logIn(){
global $_username;
global $_userpassword;
$username = $_POST['username'];
$password = $_POST['password'];
if($username === $_username && password_verify ($password , $_userpassword )){
$... | true |
6122e9500a2db7db0ea42bf6571fb7bcd284ccea | PHP | Planview/marketo-apps | /unsubscribe-pp.php | UTF-8 | 18,163 | 2.5625 | 3 | [] | no_license | <?php
require_once('./credentials.php');
$emailMessage = '';
$emailResults = 'Success';
$continue = true;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Marketo Projectplace Unsubscribe Script Results for <?php echo date("l, d M Y");?></title>
</head>
<body>
<?php
// 01 //////////... | true |
7a1f9836edfcb3edade43b75c3608e8b3de58b1c | PHP | borb/olestateagency | /database/migrations/2017_02_02_000110_create_properties_table.php | UTF-8 | 2,649 | 2.59375 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePropertiesTable extends Migration
{
/**
* Run the migration.
*
* @return void
*/
public function up()
{
... | true |
3b5cacf2d4428fe2911f1bca760744a101111010 | PHP | cuong999/laravel1 | /bscms/plugins/service/helpers/helpers.php | UTF-8 | 976 | 2.578125 | 3 | [] | no_license | <?php
use Bytesoft\Service\Repositories\Interfaces\ServiceInterface;
use Bytesoft\Service\Supports\PostFormat;
if(!function_exists('get_service')){
/**
*
* Get service on view
*
* @return mixed
* @author thuandc@bytesoft.net
* @website https://bytesoft.vn
*/
function get_se... | true |
42697cdef5b947c6ac4f383ed386d261fd593beb | PHP | lyovav/eXpansion | /LocalRecords/Events/Listener.php | UTF-8 | 844 | 2.640625 | 3 | [] | no_license | <?php
namespace ManiaLivePlugins\eXpansion\LocalRecords\Events;
use ManiaLive\Event\Listener as EventListener;
use ManiaLivePlugins\eXpansion\LocalRecords\Structures\Record;
/**
* Listener interface for local records
* @author Petri
*/
interface Listener extends EventListener
{
/**
* Event trig... | true |
39d52830bd01cd9d77d6779178f662e5064c53f6 | PHP | chuihoc/ERP_Project | /app/Model/Orders.php | UTF-8 | 7,380 | 2.625 | 3 | [] | no_license | <?php
namespace App\Model;
use \App\Helper\Data;
class Orders {
protected $db;
protected $isSuper;
protected $userId;
const STORE_PREFIX = 'NT';
const STORE_STARTER_NUM = 1000;
public function __construct($db, $isSuper = false, $userId = '') {
$this->db = $db;
$this->isSuper = $isSuper;
$this-... | true |
02e169e6354b52d7ca8183aa0b5e3d94f4de8f7c | PHP | KiazimKhutaba/my-site | /src/Core/Routing/AnnotatedClassLoader.php | UTF-8 | 948 | 2.765625 | 3 | [] | no_license | <?php
namespace Castels\Core\Routing;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use RegexIterator;
/**
* Class AnnotatedClassLoader
* @package Castels\Routing
*
* Loads files by mask recursively
*/
class AnnotatedClassLoader
{
/**
* @param $path
* @param string $namespace_pre... | true |
a539559fcec900b5ed70db7a61a64405e6d8df5d | PHP | Kravatka/puzzles | /validBraces(6).php | UTF-8 | 594 | 3.109375 | 3 | [] | no_license | <?php
function validBraces($braces) {
$opened = array();
foreach (str_split($braces) as $char) {
if (in_array($char, str_split('([{'))) {
$opened[] = $char;
}
else if ($char == ')') {
if (array_pop($opened) !== '(') {
return false;
}
}
els... | true |
8878365ec89ef7dc306c8d2325b8ff7ae5dd6621 | PHP | bit-business/commerce-module | /src/Models/Cart.php | UTF-8 | 1,098 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace NadzorServera\Skijasi\Module\Commerce\Models;
use Illuminate\Database\Eloquent\Model;
use NadzorServera\Skijasi\Models\User;
class Cart extends Model
{
protected $table = null;
/**
* Constructor for setting the table name dynamically.
*/
public function __construct(array $attri... | true |
1e5ef2a397396caf3e2fa151f84d847f8ad49545 | PHP | chouchong/qingmai | /ThinkPHP/Library/Org/Pay/WxPay.class.php | UTF-8 | 6,535 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | <?php
//微信支付操作类
namespace Org\Pay;
use Think\Controller;
class WxPay extends Controller{
// JSSDK签名
public function signature($jsapi_ticket, $noncestr, $timestamp, $url) {
$string = "jsapi_ticket=$jsapi_ticket&noncestr=$noncestr×tamp=$timestamp&url=$url";
$signature = sha1($string);
return $sig... | true |
51d57ee4bd3249e4df437e99b04536d0a9c27147 | PHP | mixmasteru/ha_api | /src/Exception/Parameter.php | UTF-8 | 204 | 2.53125 | 3 | [] | no_license | <?php
namespace ha\Exception;
class Parameter extends Base
{
public function __construct($message, $code = 0, $previous = null)
{
parent::__construct($message, $code, $previous);
}
} | true |
12aac289e0916aa6874e35fbe93e281b2a3dfa68 | PHP | larriereguichet/boboforce3 | /src/Factory/ProductFactory.php | UTF-8 | 1,023 | 3.0625 | 3 | [
"MIT"
] | permissive | <?php
namespace Factory;
use Entity\Product;
use Symfony\Component\PropertyAccess\PropertyAccessor;
/**
* Class ProductFactory.
*
* @author Johan Dufour <johan@larriereguichet.fr>
*/
class ProductFactory
{
/**
* @var PropertyAccessor
*/
private $propertyAccessor;
/**
* ProductFactory ... | true |
2c87c70c423c07c6361b6796748b5e5cfd5c3ce6 | PHP | kspitfire/hexlet-practice | /php/[PHP] Ассоциативные массивы/practice/03. Ассоциативный массив в действии/Arrays.php | UTF-8 | 871 | 3.140625 | 3 | [] | no_license | <?php
namespace App\Arrays;
/*
Реализуйте функцию `getIn`, которая извлекает из массива (который может быть любой глубины вложенности) значение по указанным ключам. Аргументы:
- Исходный массив
- Массив ключей, по которым ведется поиск значения
В случае, когда добраться до значения невозможно, возвращае... | true |
cc17735f2f3794643f50fe459d644d4096078594 | PHP | kannabanana/Database-Project | /views/review_video.php | UTF-8 | 10,693 | 2.734375 | 3 | [] | no_license | <?php
/* Get videos posted by the current user */
// Start the session
session_start();
// Connect to database
include 'database_configuration.php';
// Declare variables
$major = $_SESSION['major'];
// Define query
$sql0 = "SELECT * FROM Videos";
$sql1 = "SELECT * FROM Comments";
$sql2 = "SELECT * FROM Keywords";
... | true |
40b38df2f7c8324bf90fa52b10701cc67ea06aa9 | PHP | xiayiyongphper/api | /service/proto/7/message/contractor/HomeResponse.php | UTF-8 | 12,318 | 2.75 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/**
*
* service.message.contractor package
*/
namespace service\message\contractor;
/**
* HomeResponse message
*/
class HomeResponse extends \framework\protocolbuffers\Message
{
/* Field index constants */
const contractorstatics = 1;
const stores = 2;
const visited = 3;
const review_inf... | true |
75f67a5b0c15b00f2082287895c5c0be43e0d05c | PHP | simonahlstrom/TODO | /php/register.php | UTF-8 | 680 | 2.546875 | 3 | [] | no_license | <?php
include('connectToDB.php');
// Uploads new user to DB
$pdo = connectDB();
$query = "INSERT INTO User (username, email, password, occupation, themeId) VALUES (?, ?, ?, ?, (SELECT themeId FROM Theme LIMIT 1))";
$sql = $pdo->prepare($query);
$sql->bindParam(1, $_GET['username']);
$sql->bindParam(2, $_GET['email'])... | true |
02cd18a31de29652d4e22ed91d1ad8f28bfa9a89 | PHP | SkysoulDesign/TempArk | /app/Models/Project/Stages/Review.php | UTF-8 | 655 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace DreamsArk\Models\Project\Stages;
use DreamsArk\Models\Project\Project;
use DreamsArk\Models\Traits\ProjectableTrait;
use Illuminate\Database\Eloquent\Model;
class Review extends Model
{
use ProjectableTrait;
/**
* The database table used by the model.
*
* @var string
*/
... | true |
86632c7e634243d34d6028ebb42072b69586cf7d | PHP | gait206/Vos-en-Vos-Project | /login/loginscherm2.php | UTF-8 | 3,121 | 2.625 | 3 | [] | no_license | <?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
if (validToken($link) != true) {
// kijken of alle invoervelden ingevuld zijn
if (isset($_POST["actie"]) && !empty($_P... | true |
3449aae422140e63f966c860dc5ae7c28c37aee0 | PHP | kataynoi/ph_stat | /application/models/Report_cio_model.php | UTF-8 | 2,959 | 2.515625 | 3 | [] | no_license | <?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
*
*/
class Report_cio_model extends CI_Model
{
var $table = "data_result";
var $order_column = Array('kpi_name','kpi_type','month_time','amp','calc_result','point',);
function make_query()
{
$this->db->from($this->t... | true |
2e84a9166f7e94d06fc300b553236cf2fb851a68 | PHP | DanielSA123/ejerciciosphp | /AgendaMVC/fuente/Repositorio/ProvinciaRepositorio.inc | UTF-8 | 571 | 2.78125 | 3 | [] | no_license | <?php
class ProvinciaRepositorio
{
public function findAllProvincias(): array
{
$sql = "SELECT nombre
FROM provincia";
require_once __DIR__ . '/../../core/conexionBd.inc';
try {
$con = (new ConexionBd())->getConexion();
$stm = $con->query($sql);
... | true |
4e5b6d95fcf0dbaaccd14c13fc36967aeed9a17e | PHP | hasantayyar/phpBibTeXparser | /test/BibtexLexerTest.php | UTF-8 | 1,093 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
/** PHPUnit Framework */
require_once 'PHPUnit/Autoload.php';
require_once '../src/phpBibTeXparser.php';
class BibtexLexerTest extends PHPUnit_Framework_TestCase {
public function testString() {
$iter = new TextIterator_pBTXp("@string(foo={bar})");
$lexer = new BibtexLexer_pBTXp();
$tokens = $lexer->token... | true |
63df4bab4445f64b69587dca197bbe2a2f8d7cea | PHP | bobderrico80/projectbass | /lib/functions.php | UTF-8 | 7,202 | 3.0625 | 3 | [] | no_license | <?php
//Connects to user database
function userConnect() {
//MySQL connection variables
$hostname = 'localhost';
$user = 'rhytxfpd_pbu' . $_SESSION['SESS_USER_ID'];
$pw = $_SESSION['SESS_USER_PW'];
$database = 'rhytxfpd_projectbass_' . $_SESSION['SESS_USER_ID'];
... | true |
9e8ec6084c232c71a1b352044374a6bbb691bd68 | PHP | snobole/payment | /src/Services/Arr.php | UTF-8 | 1,645 | 3.03125 | 3 | [
"MIT"
] | permissive | <?php
namespace Snobole\Services;
class Arr
{
private $missingKeys = null;
public function flatten(array $array)
{
$return = array();
foreach ($array as $key => $value) {
if (is_array($value)) {
$return = array_merge($return, self::flatten($value));
... | true |
2454a846685d0a6673f031a59b182f480aa01679 | PHP | RocketLiga123/Back-end | /FileAdd.php | UTF-8 | 456 | 2.578125 | 3 | [] | no_license | <?php
print_r($_POST);
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "Pogoda";
try{
$conn = new PDO("mysql:host=$servername;dbname=$dbname;",$username,$password);
$sql = "INSERT INTO data (Index,City,Datetimes,DateSearch,Weather,Temp,Pressure)
VALUES(City,Date1,Date2,Weather,Te... | true |
f7d2d6511614d33e4a36c8d448bc9879d08d0b38 | PHP | akash130013/cannabis_laravel | /app/Http/Services/CategoryService.php | UTF-8 | 1,556 | 2.578125 | 3 | [] | no_license | <?php
namespace App\Http\Services;
use App\Helpers\CommonHelper;
use App\Models\Category;
class CategoryService
{
/**
* @var Category
*/
protected $category;
/**
* CategoryService constructor.
*/
public function __construct()
{
$this->category = new Category();
... | true |
e7a982bea392f5b94898289b0fc566091563584a | PHP | ustrico/job | /bundles/app/assets/templates/tasks/list.php | UTF-8 | 2,546 | 2.5625 | 3 | [] | no_license | <?php
$monthprice = 0;
echo '<ul id="tasks" class="uk-list uk-list-line">';
foreach ($tasks as $task) {
$finalprice = 0;
echo '<li data-id="' . $task->id . '" class="uk-grid task">';
echo '<div class="id uk-width-1-10">';
echo '<a href="/tasks/view/' . $task->id . '" data-href="/tasks/view/' . $tas... | true |
c469f896da910f49edbeddf0b720187d55e2ee88 | PHP | Loick-dev/06SQL | /includes/read.inc.php | UTF-8 | 971 | 2.53125 | 3 | [] | no_license | <?php
$recup = $bdd->prepare('SELECT * FROM apprenants');
$recup->execute();
// var_dump($recup);
?>
<h2>Liste</h2>
<table class="table">
<thead>
<tr>
<th>N°</th>
<th>Prénom</th>
<th>Code Postal</th>
<th>Ville</th>
<th>Modifier</th>
... | true |
997d298fa4b0b550bd143f4ce580344dbe72c417 | PHP | arturnawrot/plagiarism-checker | /app/Http/Controllers/PlagiarismController.php | UTF-8 | 2,732 | 2.640625 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Nawrot\PlagiarismChecker\Entities\Essay;
use Nawrot\PlagiarismChecker\DataProviders\Bing\BingDataProvider;
use App\Services\PlagiarismCheckerService;
use App\DataProviders\LocalDataProvider;
use App\Factories\DataProviderWorkerFactory;
use App\Mod... | true |
8d8794b9197a6d52cb7cdaf32c25236730954a6b | PHP | Tyrael/bytekit | /examples/disassemble_simple.php | UTF-8 | 740 | 2.84375 | 3 | [] | no_license | <?php
$filename = $_SERVER['argv'][1];
if (!file_exists($filename)) {
die("File not found.");
}
$res = bytekit_disassemble_file($filename);
foreach ($res['functions'] as $functionname => &$function) {
echo $functionname, ":\n";
for ($i=0; $i<count(... | true |
527a2267a2dc768391e2edcb19e4f10800fbead8 | PHP | kaoken/laravel-mysql-email-log | /database/migrations/2017_09_17_000001_create_logs_table.php | UTF-8 | 1,444 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateLogsTable extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
if( !Schema::hasTable('logs') ) {
Schema::create... | true |
3bc8972c7a92e1d2c2e617072d5f95f0174af95b | PHP | eddible95/CZ2006 | /DataAccessObject/carparkInfoDAO.php | UTF-8 | 997 | 2.734375 | 3 | [] | no_license | <?php
// get the contents of the JSON file
$carparkJsonData = file_get_contents('database/carparkAPI.json');
//decode JSON data to PHP array
$carparkContent = json_decode($carparkJsonData, true);
$totalCarpark = sizeof($carparkContent['value']);
$carparkID = [];
$carparkDev... | true |
e365fed0ac260f44913908f094caf54ee3196167 | PHP | todokku/herokugithubphp | /helloworld.php | UTF-8 | 437 | 2.515625 | 3 | [] | no_license | <?php
$host = 'us-cdbr-iron-east-01.cleardb.net';
$dbuser = 'b201689fe510f0';
$dbpwd = '12117bab';
$dbname = 'heroku_38954b5e03dd24b';
$db = new mysqli($host, $dbuser, $dbpwd, $dbname);
if ($db->connect_error){
echo $db->connect_error;
}
$sql = "select * from user";
$res = $db->query($sql);
if ($res->num_rows>... | true |
996e17025550ff0025e86d32f97287b75f3bea2c | PHP | TheMysteriousTomato/stock-ticker | /application/models/Transactions.php | UTF-8 | 4,310 | 2.875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
class Transactions extends MY_Model2
{
function __construct()
{
parent::__construct('transactions', 'Stock', 'Player');
}
/**
* Displays the transactions grouped by the given Stock.
*
* @param $code
* @return mixed
*/
function displayTransactions($code){
... | true |
8ebd5ae43444b389c43d1f255c36be92bc77d5b7 | PHP | alaatv/vote | /app/Http/Requests/SubmitVerificationCode.php | UTF-8 | 813 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Requests;
use App\Traits\CharacterCommon;
use Illuminate\Foundation\Http\FormRequest;
class SubmitVerificationCode extends FormRequest
{
use CharacterCommon;
public function authorize()
{
return true;
}
public function rules()
{
return [
... | true |
fe81e43e34d9651ee364d8db38ec6e96d290330a | PHP | ollie-troward/unit-converter | /src/Troward/Converter/Unit/AreaUnit.php | UTF-8 | 830 | 2.90625 | 3 | [
"MIT"
] | permissive | <?php
namespace Troward\Converter\Unit;
/**
* Interface AreaUnit
* @package Troward\Converter\Unit
*/
interface AreaUnit
{
/**
* Square Kilometer unit of measurement.
*/
const SQUARE_KILOMETER = 'km²';
/**
* Square Meter unit of measurement.
*/
const SQUARE_METER = 'm²';
/... | true |
054f18262d560721bce54ae4205b58ece32b6d68 | PHP | FernandesDavi/MusicStore | /music_store/music_store/frm_contas.php | UTF-8 | 2,536 | 2.734375 | 3 | [] | no_license | <?php
include "menu.php";
include "conecta.inc";
if (!empty($_POST)) {
$conta = $_POST["conta"];
$valor = $_POST["valor"];
$dt = $_POST["dt"];
$cnt = $_POST["slcontador"];
$func = $_POST["slfuncionario"];
mysqli_autocommit($conexao, FALSE);
$erro = 0;
$query1 = "INSERT INTO contas VALUES (null,'$conta... | true |
d5db6e22d371294a6933d530e9d333f2fb3f1fa3 | PHP | cinnar12/gnvnoms | /temp.php | UTF-8 | 810 | 2.796875 | 3 | [] | no_license | <?php include 'database.php'; ?>
<?php
if (isset($_POST['refresh'])) {
refresh_table($conn);
}
function refresh_table($conn) {
$query = "SELECT * FROM restaurants ORDER BY name";
$restaurantsgnv = mysqli_query($conn, $query);
echo '<table>
<tr>
<th>Name</th>
<th>Location</th>
<th>Genre<... | true |
6b88e0de473c9bdb753daae9d6574b90f1657732 | PHP | plezzz/SoftUni-Technology-Fundamentals-with-PHP | /Basic Syntax, Conditional Statements and Loops Exercise/StrongNumber.php | UTF-8 | 683 | 3.265625 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: Niki
* Date: 25/01/2019
* Time: 17:25
*/
$input = intval(readline());
$divider = 1;
$fact=1;
$sumFact = 0;
while ($input>=$divider)
{
$fact = ($input / $divider) % 10;
for ($i = $f... | true |
3ba0d7c7f35ca8626a969493b8f024ca0df4e1f3 | PHP | phacility/phabricator | /src/applications/maniphest/xaction/ManiphestTaskMergedFromTransaction.php | UTF-8 | 863 | 2.515625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
final class ManiphestTaskMergedFromTransaction
extends ManiphestTaskTransactionType {
const TRANSACTIONTYPE = 'mergedfrom';
public function generateOldValue($object) {
return null;
}
public function getActionName() {
return pht('Merged');
}
public function getTitle() {
$new = $this-... | true |
df537b63a8583e03337e5dd299cbdbb1c26bfa74 | PHP | jessenygren/Candyshop-Speed-Date | /hiekkalaatikko/php/readCompetency.php | UTF-8 | 1,232 | 3.078125 | 3 | [] | no_license | <?php
/*
COMPETENCY!!!
Reading Competency table using CompetencyID.
Verneri Närhi
*/
//Reading get or post request
//id =
$id=$_REQUEST["x"];
//Sql database configuration variables.
$servername = getenv('IP');
$username = getenv('C9_USER');
$password = "";
$database = "NanoJobDB";
$port = 3306;
//Connecting t... | true |
eb2608552bf1fc9b21a76e2084d7d616119ef6ee | PHP | binaryk/dms | /app/Comptechsoft/Datatable/Cells.php | UTF-8 | 528 | 3.125 | 3 | [
"MIT"
] | permissive | <?php namespace App\Comptechsoft\Datatable;
class Cells
{
protected $cells = NULL;
protected $rows = NULL;
/*
* un obiect colectie de celule apartine unui obiect rows
*/
public function __construct(Rows $rows)
{
$this->rows = $rows;
$this->cells = new \Illuminate\Support\Collection();
}
/*
* Adau... | true |
35ec98e63d69abe78e0d1d6b2c769ddcdad029bd | PHP | Julienyou/Projet_Reservation | /destruction_session.php | UTF-8 | 248 | 2.671875 | 3 | [] | no_license | <?php
//Unset destroys the session object information
if (isset($_SESSION['information']))
{
unset($_SESSION['information']);
}
//Destroy the session
session_destroy();
//We redirect the client to the home page
header('location:index.php');
?> | true |
22738005d9577666b111122bbdf263d1472c7328 | PHP | EngagePHP/Luminary | /luminary/Exceptions/Presenters/HttpExceptionPresenter.php | UTF-8 | 287 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace Luminary\Exceptions\Presenters;
class HttpExceptionPresenter extends DefaultPresenter
{
/**
* Return the http status code
*
* @return int
*/
public function status() :int
{
return (int) $this->exception->getStatusCode();
}
}
| true |
a2ff653c47bc5f1214a083001f16c5cc6f61766c | PHP | shin1x1/phpcon2017 | /src/Chapter2/Domain/PriceWithTax.php | UTF-8 | 790 | 3.296875 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace Acme\Chapter2\Domain;
final class PriceWithTax
{
/** @var Price */
private $price;
/** @var TaxRate */
private $taxRate;
/**
* @param Price $price
* @param TaxRate $taxRate
*/
private function __construct(Price $price, TaxRate $taxRat... | true |
4093969efcc8eaf43324f119e16a38d89ba39af5 | PHP | sitedata/phpstan | /playground-runner/tests/data/method-generator-in.php | UTF-8 | 160 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
namespace Test;
use FooBar;
class Foo
{
public function doFoo(): iterable
{
yield 1;
yield 2;
return;
}
}
$foo = new Foo();
$foo->doFoo();
| true |
eb3df7a5ef2ef6f7a695d67f7eeed893fb31cb93 | PHP | banna76/blogsystem | /index.php | UTF-8 | 852 | 2.6875 | 3 | [] | no_license | <?php
include('header.php');
include('conn.php');
echo "<div class='text-center mb-4'> <h1 class='h3 mb-3 font-weight-normal'>Blog List</h1></div>";
$con = new DB_con();
$table = 'blogs';
$result = $con->selectAll($table);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<div class='j... | true |
1f4828348569c5ca9715355e92c63c62efdaceea | PHP | rzajac/phptools | /src/Helper/POST.php | UTF-8 | 1,104 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | <?php
/**
* Copyright 2015 Rafal Zajac <rzajac@gmail.com>.
*
* 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 a... | true |
95387cb8178f149300c47a0657775b306e26715e | PHP | lingfan/war2game | /srv/M/Battle/List.php | UTF-8 | 2,724 | 2.546875 | 3 | [] | no_license | <?php
/**
* 城市的战斗列表
* 由于副本 和 被攻击的战斗 没有 行军数据
* 所以无法 通过行军列表来 获取战斗列表
*/
class M_Battle_List {
/**
* 添加城市相关战斗
* @author huwei
* @param int $cityId
* @param int $bId
* @return bool
*/
static public function addBattleIdByCity($cityId, $bId) {
$ret = false;
$cityId = intval($cityId);
$bId = intv... | true |
a989adbfd10740cf2c809042d8173c53bee1c6f4 | PHP | ICanBoogie/Validate | /lib/Validator/Regex.php | UTF-8 | 1,137 | 2.734375 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/*
* This file is part of the ICanBoogie package.
*
* (c) Olivier Laviale <olivier.laviale@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace ICanBoogie\Validate\Validator;
use ICanBoogie\Validate\Context... | true |
2baab53734b7027888a5084434a236109e1bf1c1 | PHP | Rohit200/PhpPrograms | /Hello.php | UTF-8 | 283 | 3.21875 | 3 | [] | no_license | <?php
$subject= "Hello <<UserName>>, How are you? \n";
$search="<<Username>>";
echo "Enter the name \n" ;
fscanf(STDIN, "%s", $name);
echo $name;
echo str_replace($search,$name,$subject);
?><?php
echo "Hello World";
$value1 =25;
$value2=40;
echo "addtion is ",$value1+$value2 ;
?>
| true |
72f8b92bf3cfdc576c1d3edbc5802d4c9f271313 | PHP | tekaratzas/Comp-307-Ass-3 | /Login.php | UTF-8 | 1,787 | 2.84375 | 3 | [] | no_license | <?php
require 'vendor/autoload.php';
$app = new \Slim\Slim();
$app->post('/', function() use ($app){
$req = $app->request();
echo json_encode($req->post());
});
//$servername = 'localhost:/Applications/MAMP/Library/bin';
//$servername = 'localhost';
$DBuser = 'root';
$DBpass = 'root';
$username = '... | true |
b7d9950c0afe5c75adb9c75846d531df18e81972 | PHP | Firestitch/fs-angular-icon | /backend/models/handler/session_handler_model.inc | UTF-8 | 1,347 | 2.5625 | 3 | [] | no_license | <?
class HMODEL_SESSION extends MODEL_HANDLER {
protected $_select_fields = array("sessions.*");
function get_dbq() {
return $this->apply_constraints(DBQ_SESSION::create());
}
function gets() {
$sessions = $this->get_dbq()->select($this->_select_fields);
$session_cmodels = array();
f... | true |
b0e113c0e388a35dde7016e458092dd70de34923 | PHP | PlanBCode/hypha | /system/macros/now.php | UTF-8 | 617 | 3.125 | 3 | [] | no_license | <?php
/**
* Trivial example macro, returns the current date and time.
*
* Parameters:
* - format: The datetime format, as passed to the PHP date() function.
* See https://www.php.net/manual/en/function.date.php
*
* Example usage:
*
* <macro name="now" format="D, d M Y H:i:s"/>
*/
class NowMacro exten... | true |
614c95a8dbe62b077d9de60b62c5ece6412294a3 | PHP | MaxGoryunov/chem-proj | /factories/IModelFactory.php | UTF-8 | 314 | 3.296875 | 3 | [] | no_license | <?php
namespace Factories;
use Models\IModel;
/**
* Interface for Factories which can create Models
*/
interface IModelFactory {
/**
* Returns a specified Model
*
* @return IModel
*/
public function getModel():IModel;
}
| true |