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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
14ebf93f33d7cb0240266ae394421135cdfdb485 | PHP | amnotme/42 | /Piscine_php/Rush01/gamedata.php | UTF-8 | 1,376 | 2.8125 | 3 | [] | no_license | <?php
require_once("Game.class.php");
function session_lock() {
$mutex = fopen($_SERVER['DOCUMENT_ROOT']."/database/games.db", "a+");
flock($mutex, LOCK_EX);
return ($mutex);
}
function session_unlock($mutex) {
flock($mutex, LOCK_UN);
fclose($mutex);
}
function game_session_save($id, Game $game) {
... | true |
640d02b0eb84b23c87d656211df21dfb642ce9f4 | PHP | dreamfly2012/phptutorial | /lesson32/test.php | UTF-8 | 522 | 2.8125 | 3 | [] | no_license | <?php
class Controllercommonfooter
{
protected function index()
{
echo 'abcd';
}
}
$reflection_class = new ReflectionClass('Controllercommonfooter');
var_dump($reflection_class); #output_1
$reflection_method = $reflection_class->getMethod('index');
var_dump($reflection_method); #outpu... | true |
55b3984d28d0bf92d941b6878eae8e528324d7ca | PHP | Petersil1998/Thresh-Core | /src/Objects/QueueType.php | UTF-8 | 1,226 | 3.265625 | 3 | [] | no_license | <?php
namespace Thresh_Core\Objects;
/**
* This Class represents a Queue Type
* @package Thresh\Entities
*/
class QueueType
{
/**
* @var int
*/
private $id;
/**
* @var string
*/
private $map;
/**
* @var string|null
*/
private $description;
/**
* @va... | true |
7519523e53b96f019990a9eda4b587f5a5a31863 | PHP | paq85/WebServer | /PhpBuiltInWebServer.php | UTF-8 | 2,727 | 3.09375 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types = 1);
namespace Paq85\WebServer;
use Symfony\Component\Process\Process;
use Symfony\Component\Process\ProcessBuilder;
/**
* Class helps running PHP Built-in web server from PHP code
*
* Can be used for testing purposes
*
* @see http://php.net/manual/en/features.commandline.webserver.... | true |
37de6e5a86b3cfd3a4c1d5524de7b833679d7bc0 | PHP | xitrii/admin_test | /Entity/Page/PageFactory.php | UTF-8 | 1,930 | 3.046875 | 3 | [] | no_license | <?php
/**
* Created by IntelliJ IDEA.
* User: bimdeer
* Date: 01.06.18
* Time: 14:00
*/
/**
* Class PageFactory
* Весь sql не выходит за рамки этого класса
*/
class PageFactory
{
public static function add(PageModel $pageModel) {
$values = $pageModel->__toArray();
System::get('DbClass')-... | true |
9b28ddfc8fdd8f0cb7302d8b631f3c2e3e23c2ed | PHP | yustikodm/unio | /app/Models/PlaceToLive.php | UTF-8 | 3,900 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\DB;
/**
* Class PlaceToLive
* @package App\Models
* @version March 31, 2021, 3:27 pm WIB
*
*/
class PlaceToLive extends Model
{
use SoftDeletes;
public $table = '... | true |
d9f8ce364bfd655970ffca5b38cb7b97b94025bd | PHP | jlacetera/SampleTableUpdateFunctions | /TableAdminGateway.php | UTF-8 | 17,667 | 2.625 | 3 | [] | no_license | <?php
/* Revision History
SMC-396 JL 7/2015 - Initial Version. Supports client_labels and languages_supported tables. Additional tables can be added easily.
SMC-431 JL 10/2015 - Added bev_categories table. Added some class functions needed for bev_categories table.
... | true |
00af62095977b96968faa73e238c6f74ae4c94f5 | PHP | AR-Shahin/AJAX_with_PHP | /Autocomplete/inc/class.php | UTF-8 | 737 | 2.84375 | 3 | [] | no_license | <?php
class Dboperation{
private $con;
public function db()
{
$con = mysqli_connect('localhost:3307','root','','ajax');
return $con;
}
public function autoComplete($skill){
$sql = "SELECT * FROM `skills` WHERE `skill` LIKE '%$skill%' ";
$res = $this->db()->query($sq... | true |
28495aa8ab02666239ca67507933d20e2f08fcfa | PHP | conperience/lucille | /tests/components/xmlcontent/exceptions/LoadingXmlFailedException.php | UTF-8 | 1,216 | 2.515625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php declare(strict_types=1);
namespace Lucille\UnitTests;
use Lucille\Components\Xml\Exceptions\LoadingXmlFileFailedException;
use Lucille\Filename;
use PHPUnit\Framework\TestCase;
/**
* @coversDefaultClass \Lucille\Components\Xml\Exceptions\LoadingXmlFileFailedException
*/
class LoadingXmlFailedException ex... | true |
05616e5a543c505cda27a2e433987bad00efb56b | PHP | Wedeto/Mail | /src/Mime/Attachment.php | UTF-8 | 3,024 | 2.609375 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/*
This is part of Wedeto, the WEb DEvelopment TOolkit.
Wedeto\Mail is published under the BSD 3-Clause License.
Copyright 2017, Egbert van der Wal.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of ... | true |
343b31e442d8c11e065b5025475fde24e91056c8 | PHP | ProtonMail/bitcoin-php | /tests/Script/Interpreter/NumberTest.php | UTF-8 | 1,632 | 2.921875 | 3 | [
"Unlicense",
"LicenseRef-scancode-free-unknown"
] | permissive | <?php
declare(strict_types=1);
namespace BitWasp\Bitcoin\Tests\Script\Interpreter;
use BitWasp\Bitcoin\Script\Interpreter\Number;
use BitWasp\Bitcoin\Tests\AbstractTestCase;
use BitWasp\Buffertools\Buffer;
class NumberTest extends AbstractTestCase
{
/**
* @return array
*/
public function getVector... | true |
21cc88f4be0e50b8885df4db4d669071d376a63b | PHP | evodevo/payments_api | /tests/Behat/PaymentsApiContext.php | UTF-8 | 3,143 | 2.546875 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace PaymentsAPI\Tests\Behat;
use Behat\Behat\Context\Context;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Mink\Driver\DriverInterface;
use Behat\MinkExtension\Context\RawMinkContext;
use PaymentsAPI\Application\Command\ProcessTransactions;
use PaymentsAPI\Application\Command\P... | true |
0b133555d298dc9a218bad8e37dcc707378e279a | PHP | kooser6/Phoenix | /src/Evaluation/CombinedEvaluator.php | UTF-8 | 803 | 2.96875 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace Phoenix\Evaluation;
use Phoenix\Batch\Evaluator;
use Phoenix\Batch\Position;
final class CombinedEvaluator implements Evaluator
{
/**
* @var Evaluator[]
*/
private $evaluators;
/**
* Consturct multiple evaluators.
*
* @return void Returns... | true |
d14eb79e200803b3e61612d1a523ad652506e207 | PHP | KulikovK/jagu | /Modules/admin/API/AddAcademicGrpup.php | UTF-8 | 1,482 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | <?php
// API: добавление академической группы
require_once($_SERVER['DOCUMENT_ROOT'].'/cfg/core.php');
if (empty($_POST) || isAuthUser() != 'admin')
exit('<p class="alert alert-danger">Ошибка обработки данных!</p>');
$ArrayData = array();
$ArrayData = $_POST;
$ArrayData['Headman']=null;
foreach ($ArrayData as $k... | true |
5d84fc8ce1eba7ffe350ceac6860e6d3c913247e | PHP | trigladon/musehouse-schedule | /modules/master/models/Schedinstricon.php | UTF-8 | 1,773 | 2.640625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace app\modules\master\models;
use Yii;
use yii\db\ActiveRecord;
/**
* This is the model class for table "schedinstricon".
*
* @property integer $id
* @property integer $instricon_id
* @property integer $userschedule_id
* @property string $created_at
* @property string $updated_at
*
* @property ... | true |
f7e174046e27f0640c748e24fafa4971772885fb | PHP | michelepapagni/laravel-boolpress-livecoding | /database/seeds/PostsTableSeeder.php | UTF-8 | 706 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Seeder;
use Faker\Generator as Faker;
use App\Post;
use App\Category;
use Illuminate\Support\Str;
class PostsTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run(Faker $faker)
{
for ($i = 0; $i < 10; $i... | true |
3b6307e507ac4b9df00b7ee1cde290999fb3f3d3 | PHP | diggin/Diggin_Scraper | /src/Diggin/Scraper/Strategy/Flexible.php | UTF-8 | 3,343 | 2.640625 | 3 | [] | no_license | <?php
/**
* Diggin - Simplicity PHP Library
*
* LICENSE
*
* This source file is subject to the new BSD license.
* It is also available through the world-wide-web at this URL:
* http://diggin.musicrider.com/LICENSE
*
* @category Diggin
* @package Diggin_Scraper
* @copyright 2006-2011 sasezaki (http:/... | true |
839ab68b9702b1961764d77cfdaeefd7ef727978 | PHP | rblasquez/mybooktravel | /app/Exceptions/Handler.php | UTF-8 | 3,941 | 2.640625 | 3 | [] | no_license | <?php
namespace App\Exceptions;
use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\Debug\Exception\FlattenException;
use InvalidArgumentException;
use Illuminate\Session\TokenMismatchException;
use Symfony\Component\Debug... | true |
b4131db175246625e2d3d5068dfc8143678b8f7f | PHP | Eliepse/mailgrate | /app/Account.php | UTF-8 | 2,089 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Carbon\Carbon;
use Eliepse\Imap\Utils;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* Class Account
*
* @package App
* @property-read int id
* @property string host
* @property string user... | true |
3f5aa24a9c2675a4e6c302df0e53f0490fac4997 | PHP | didbot/didbot-api | /src/Models/Tag.php | UTF-8 | 1,351 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
namespace Didbot\DidbotApi\Models;
use Illuminate\Database\Eloquent\Model;
use Didbot\DidbotApi\Traits\Uuids;
use DB;
class Tag extends Model
{
use Uuids;
public $incrementing = false;
/*
|--------------------------------------------------------------------------
| Accessors & Mutators
... | true |
63d53abc9e693b8e2baf6a2df9d4d988aba302e2 | PHP | furiospro/cardoor | /article.php | UTF-8 | 3,080 | 2.625 | 3 | [] | no_license | <?php
use classes\GetImages;
/*
* Template name: article
* Template post type: post, page
*/
?>
<?php get_header();?>
<?php while(have_posts()): the_post();
$content = $post->post_content;
/*function custom_strip_tags( $string, $remove_breaks = false ){
$string = preg_replace( '/<img.*?>/si', '', $string )... | true |
0408c4c197ab2b8abc83688224dd6fa6e11e8373 | PHP | cbarberis/sscpmodule | /code/model/BlockHolder.php | UTF-8 | 1,696 | 2.671875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
class BlockHolder extends DataObject {
static $db = array(
'Title' => 'Varchar',
'TemplateKey' => 'Varchar',
'Description' => 'Text',
'ShowDefaultSnippet' => 'Boolean'
);
static $defaults = array(
'ShowDefaultSnippet' => false
);
static $summary_fields = array(
'Title',
'TemplateKe... | true |
c39846ac6f7aad3623b06fcb74dd4cb743a1fea5 | PHP | chuckbe/chuckcms-module-booker | /src/Chuck/LocationRepository.php | UTF-8 | 6,858 | 2.578125 | 3 | [] | no_license | <?php
namespace Chuckbe\ChuckcmsModuleBooker\Chuck;
use Chuckbe\ChuckcmsModuleBooker\Requests\StoreLocationRequest;
use Chuckbe\ChuckcmsModuleBooker\Models\Location;
class LocationRepository
{
private $location;
public function __construct(Location $location)
{
$this->location = $lo... | true |
0584b7a49f48cce8c4d0f4a7b101ec2217b9d5d2 | PHP | ahmediqu/quickadminpanel | /app/Http/Controllers/Backend/CourseController.php | UTF-8 | 3,096 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Backend;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Auth;
use App\Model\Course;
class CourseController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function inde... | true |
bb0a7454f1fb51427e31a2d4ec55f794c39c9045 | PHP | erickmcarvalho/likepdo | /src/LikePDO/Instances/LikePDOStatement.php | UTF-8 | 35,748 | 2.953125 | 3 | [
"MIT"
] | permissive | <?php
/**
* LikePDO - The Statement Class
*
* @name PHP Like PDO
* @author Érick Carvalho <http://www.github.com/erickmcarvalho>
*/
namespace LikePDO\Instances;
use LikePDO\LikePDO;
use LikePDO\LikePDOException;
use LikePDO\Instances\LikePDORow;
use ReflectionClass;
use stdClass;
class LikePDO... | true |
066718a0f5cdf502a7b8fae15e675871ad99e869 | PHP | imorikenn/YPHPSample | /06/sample11.php | UTF-8 | 581 | 3.828125 | 4 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<title>サンプル</title>
</head>
<body>
<?php
$test= array(22, 80, 75, 60, 50);
sort($test);
?>
<h3>昇順</h3>
<table border="2">
<tr bgcolor="#AAAAAA">
<th>番号</th>
<th>点数</th>
</tr>
<?php
foreach($test as $id => $value){
echo "<tr><td>{$id}</td><td>{$value}</td></tr>\n";
}
rsort($test)... | true |
d158372220549ad435489e7c305c36abfdc9c81f | PHP | mehdichouania/Made-In-World | /oublimdp.php | UTF-8 | 1,365 | 2.703125 | 3 | [] | no_license | <?php
session_start();
require_once "config.php";
// l'ID de l'utilisateur, présent dans le GET via la variable "uid"
$userId = isset($_GET['uid']) ? trim($_GET['uid']) : '';
// Le token de la requete, présent dans le GET via la variable "t"
$token = isset($_GET['t']) ? trim($_GET['t']) : '';
// L'ID de la req... | true |
4cd6d853b34b0684d962dc6ddb5fc5d12563c729 | PHP | bomj321/inmobiliaria | /propiedades/senciyaPeriodos.php | UTF-8 | 9,212 | 2.609375 | 3 | [] | no_license | <?php
$id = $_GET['idrental'];
function generar_calendario_precios($year,$month,$id){
// precios de la base de datos
include('../includes/conexion_nueva.php');
$tabla = 'sys_pricerange';
$sql = 'SELECT precio,fecha,tipo FROM '.$tabla.' WHERE id_propiedad = '.$id.' AND fecha >= "'.$year.'-'.$month.'-1" AND fecha<... | true |
daa7234f910b5efaeb46fcdef9ef315a63fbb4d6 | PHP | adesinataiwoolajide/abvbooks.com | /dev/Shipping.php | UTF-8 | 5,145 | 2.90625 | 3 | [] | no_license | <?php
class Shipping extends Account{
private $phone;
private $street_address;
private $state;
private $country;
private $landmark;
private $city;
public $locationId;
public $location;
public function getState($state)
{
return $this->state = $state;
}
public function getCountry($country)
... | true |
6dcbfb8580babae6503e2399591d52e2392ccbe1 | PHP | mo7am/HotelSystemUsingLaravel | /database/migrations/2020_10_26_064112_create_staff_table.php | UTF-8 | 1,230 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateStaffTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('staff', function ... | true |
b9b3429caaac2111c722033f14e35b4ecde14554 | PHP | WangZhenchaoESGI/Symfony | /src/Controller/SecurityController.php | UTF-8 | 1,896 | 2.578125 | 3 | [] | no_license | <?php
namespace App\Controller;
use App\Entity\User;
use App\Form\RegistrationType;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpF... | true |
efcbc3b47d7c747384f9a603ea1cbcca246c5ecf | PHP | lancy/MyNotes | /API/prefix.php | UTF-8 | 14,202 | 2.765625 | 3 | [] | no_license | <?php
/**
* Created by JetBrains PhpStorm.
* User: lancy
* Date: 4/12/12
* Time: 1:07 AM
* To change this template use File | Settings | File Templates.
*/
error_reporting(E_ALL ^ E_NOTICE);
function connectToDefaultDatabase() {
$serverName = ":/Applications/MAMP/tmp/mysql/mysql.sock";
$mysqlUsername = "... | true |
d3bfc71387e0ce437dd11962472f662a9857862a | PHP | catwrench/PhpPatterns | /app/PhpPatterns/action/Mediator/Tenant.php | UTF-8 | 474 | 2.796875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: yw
* Date: 2021/3/17
* Time: 1:30 下午
*/
namespace App\PhpPatterns\action\Mediator;
/**
* 租客类,继承了客户抽象类
*/
class Tenant extends CustomerAbstract
{
//租房操作
function doSomething(CustomerAbstract $customer)
{
//通过中介租房
$this->mediator->rent($this);
... | true |
624ac24edc2160eb9217e8d97bbcc1c542105adc | PHP | bonnconvention/migratoryspecies | /docroot/profiles/e_community/modules/ecommunity/templates/upcoming_meetings_block.tpl.php | UTF-8 | 1,390 | 2.5625 | 3 | [] | no_license | <?php
$items = $variables['items'];
$meetings = $items['meetings'];
?>
<?php if(!empty($meetings)): ?>
<ul class="ws-upcoming-meetings">
<?php
$c = count($meetings) - 1;
foreach($meetings as $i => $row):
$cssClass = '';
if($i == 0) { $cssClass = ' class="first"'; };
if($i == $c) { $cssClass = ' class=... | true |
57f263ea6da6f297123e0344ab21ee870f34489b | PHP | marcorcau/drupal-custom-entity | /src/ProjectInterface.php | UTF-8 | 1,099 | 2.671875 | 3 | [] | no_license | <?php
namespace Drupal\project;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\user\EntityOwnerInterface;
use Drupal\Core\Entity\EntityChangedInterface;
/**
* Provides an interface defining a project entity type.
*/
interface ProjectInterface extends ContentEntityInterface, EntityOwnerInterface, EntityC... | true |
da31719c03c7174874548ea917690d5faee23eeb | PHP | superinu100/moments-backend | /library/Welfony/Welstory/Repository/FollowRepository.php | UTF-8 | 4,105 | 2.65625 | 3 | [] | no_license | <?php
// ==============================================================================
//
// This file is part of the WelStory.
//
// Create by Welfony Support <support@welfony.com>
// Copyright (c) 2012-2014 welfony.com
//
// For the full copyright and license information, please view the LICENSE
// file that was di... | true |
7125e4ce8a0b575d58a09a904f55f1ae8c438bc8 | PHP | conilacianaforri/valutazione_alunno | /src/Valutazione/Alunno/Strategy/Media/MediaOrdinaria.php | UTF-8 | 623 | 2.53125 | 3 | [] | no_license | <?php
namespace Valutazione\Alunno\Strategy\Media;
use Valutazione\Alunno\Entity\Alunno;
class MediaOrdinaria extends AbstractMedia
{
/**
* @inheritdoc
*/
public function calcolaMedia(Alunno $alunno): float
{
if (!$this->isApplicabile($alunno)) {
throw new \InvalidArgumentE... | true |
449b60d5776adeb51fe4a6ed3d4ce478735b85ca | PHP | lmachry/tcc | /ctrl/BairroDAO.php | UTF-8 | 1,929 | 3.03125 | 3 | [] | no_license | <?php
include_once 'conexao.php';
include_once '../../model/Bairro.php';
/**
* Description of BairroDAO
*
* @author DouglasMachry
*/
class BairroDAO extends Bairro{
public function inserir(Bairro $bairro){
$insert = mysql_query("INSERT INTO bairros (nome,municipio,teleEntrega) "
... | true |
59b094097443b14fab5d1b7e03dce99414f28593 | PHP | vominhnhut10121991/vcbf | /DATABASE/VCBF/vcbf_portfolio_industry_breakdown_bcf.php | UTF-8 | 4,666 | 2.75 | 3 | [] | no_license | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
require("vcbf_database_connection.php");
require("vcbf_function.php");
session_start();
if(!isset($_SESSION['login']))
header("location:vcbf_login.php");
$allowedExts = array("xlsx","xls");
$temp = explode(".", $_FILES["file"]["name"]);
$ex... | true |
e0ce946769497e25eaf9461345b1ce0d84ca7957 | PHP | RichardvBoyd2/Blog | /CST-126_Blog/Post/ratePost.php | UTF-8 | 1,838 | 2.75 | 3 | [] | no_license | <!--
CST-126_Blog Ver 8.0
ratePost Ver 1.0
Author: Richard Boyd
10MAY19
Handles the post data when rating a post
-->
<html>
<head>
<title>Rating Post</title>
<link rel="stylesheet" type="text/css" href="../style.css">
</head>
<body>
<div class="navbar">
<a href="../Home/home.php">Home</a... | true |
940ad20f1f9f683cfd18aee3980a27673f9c6d18 | PHP | fat7i/parking-lot | /app/Tasks/DepartTask.php | UTF-8 | 822 | 2.9375 | 3 | [] | no_license | <?php
namespace App\Tasks;
use App\Repositories\ParkableRepository;
class DepartTask implements TaskInterface
{
/**
* @var ParkableRepository
*/
private $parkableRepository;
/**
* @var string
*/
private $plate;
/**
* DepartTask constructor.
* @param ParkableReposi... | true |
d91dd1b5868a5dd924d0c7209af27533fc19dd69 | PHP | Zuruuh/Gaucode-blog | /src/Service/AuthorService.php | UTF-8 | 965 | 2.96875 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace App\Service;
class AuthorService
{
private ArticleService $articleService;
public function __construct(ArticleService $articleService)
{
$this->articleService = $articleService;
}
public function getAuthors(): array
{
$authors = [];
... | true |
e29c4e8d04043af87f595835000dbcfd3aa71936 | PHP | codercast/RealFizzBuzz | /src.php | UTF-8 | 321 | 4 | 4 | [] | no_license |
<?php
$num;
for ($num = 1; $num <= 20; $num++)
{
if (str_contains($num, 3) == true)
echo "lucky ";
else if ($num % 15 == 0)
echo "fizzbuzz ";
else if (($num % 3) == 0)
echo "fizz ";
else if (($num % 5) == 0)
echo "buzz ";
else
echo $num . " ";
}
?>... | true |
81117e2dd3321953d3131a96952972209bc6053a | PHP | freefcw/Eloquent-Repositories | /src/Traits/ControllerTrait.php | UTF-8 | 1,336 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of Eloquent Repositories.
*
* (c) Brian Faust <hello@brianfaust.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/*
* This file is part of Eloquent Repositories.
*
* (c... | true |
cb0b0aef30416223bb94cd5d820ee21311dcdff4 | PHP | MVigilus/php7 | /connessione.php | UTF-8 | 758 | 2.65625 | 3 | [] | no_license | <?php
$host="sql105.epizy.com";
$username="epiz_25339938";
$password="857G5NAoj7";
$db_nome="epiz_25339938_db1";
$tab_nome="prodotti";
$conn=mysqli_connect($host,$username,$password);
if(!$conn){
die("errore connessione " . mysqli_connect_error());
}
mysqli_select_db($... | true |
81b7f6596bf0d77c27b8aa3489e3e7e81da71aa7 | PHP | sshyran/warp.me-framework_non_yootheme_third_party_name | /src/Warp/Core/Application.php | UTF-8 | 5,093 | 2.890625 | 3 | [
"MIT"
] | permissive | <?php
/**
* Application class
* @author Jake Josol
* @description Class that is responsible for the entire application
*/
namespace Warp\Core;
use Warp\Http\Router;
use Warp\Data\Database;
use Warp\Session\Session;
use Warp\Utils\Debugger;
use Warp\Utils\Enumerations\DebugMode;
use Warp\Utils\Interfaces\IElement... | true |
2b617b897420305e6cf02505ebbb24df404220b4 | PHP | radovinetch/SimpleMVC | /src/middleware/AdminMiddleware.php | UTF-8 | 643 | 2.734375 | 3 | [] | no_license | <?php
namespace SimpleMvc\middleware;
use SimpleMvc\http\Request;
use SimpleMvc\http\Response;
use SimpleMvc\model\User;
use SimpleMvc\session\Session;
class AdminMiddleware implements IMiddleware
{
public function handle(Request $request, Response $response): bool
{
$session = Session::getInstance... | true |
795d8bb5537368d4072fee5ce07e60d5d496b500 | PHP | KnsRoo/duplet | /public/classes/Model/Interview/Journal.php | UTF-8 | 994 | 2.875 | 3 | [] | no_license | <?php
namespace Model\Interview;
use Websm\Framework\Db\ActiveRecord;
Class Journal extends ActiveRecord {
public static $table = 'interview_journal';
public $id;
public $quiz_id;
public $ip;
public function getRules() {
return [
['quiz_id', 'required'],
['ip... | true |
27313a5ae0b1adeb8cb514d7cc857f9b49c2a3d2 | PHP | KBlbym/E2_MF0943_3 | /validarEmail.php | UTF-8 | 1,470 | 2.671875 | 3 | [] | no_license | <?php
include('config.php');
//validar email de lado del servidor
if (($_POST['email'] != null && isset($_POST['email']) && isset($_POST['submit']))) {
$email = $_POST['email'];
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
//Verificamos que el email no exista en la base de datos
$stmtCheck =... | true |
582f4ca160e14ec2c62b82a874bf316276c1cbff | PHP | timglabisch/simpleredisqueue | /src/Consumer/Service/ConsumerStatusService.php | UTF-8 | 2,740 | 2.546875 | 3 | [] | no_license | <?php
namespace Tg\RedisQueue\Consumer\Service;
use Tg\RedisQueue\Consumer\ConsumerContext;
use Tg\RedisQueue\Consumer\Status\CodecException;
use Tg\RedisQueue\Consumer\Status\StatusCodecInterface;
use Tg\RedisQueue\Consumer\Status\StatusInterface;
use Tg\RedisQueue\Consumer\Status\StatusStartedCodec;
class Consumer... | true |
9e93fc6cb3b8307d3a62dd0bc39c111d99df2b85 | PHP | SyntesyDigital/ArchitectATS | /Jobs/Candidate/CreateFile.php | UTF-8 | 829 | 2.546875 | 3 | [] | no_license | <?php
namespace Modules\RRHH\Jobs\Candidate;
use Modules\RRHH\Http\Requests\Admin\Candidate\CreateFileRequest;
class CreateFile
{
public function __construct($file)
{
$this->file = $file;
}
public static function fromRequest(CreateFileRequest $request)
{
return new self($request-... | true |
8554ba7c12a338d42558250b05ea951f00424c8d | PHP | yujin1st/core | /modules/settings/models/Setting.php | UTF-8 | 1,097 | 2.578125 | 3 | [] | no_license | <?php
/**
*
* @info Core for yii applications with modules
* @link https://github.com/yujin1st/core
*
* @author Evgeniy Bobrov <yujin1st@gmail.com>
* @link http://yujin1st.ru
*
*/
/**
* @author Evgeniy Bobrov <yujin1st@gmail.com>
* @copyright Fastweb
* @link http://fastweb.ru <info@fastweb.ru>
*/
namespac... | true |
a4d1b9a76e607d1cee0b09386c1769dd322d8b06 | PHP | FerCar1999/sgcs | /app/controllers/EtiquetaController.php | UTF-8 | 3,744 | 2.765625 | 3 | [] | no_license | <?php
//llamando el archivo app
require_once '../../config/app.php';
//llamando el archivo modelo de la tabla categoria
require_once APP_PATH . '/app/models/Etiqueta.php';
session_start();
try {
//inicializando la clase de contacto
$etiqueta = new Etiqueta;
//si el post es para llenar campos que no tienen q... | true |
2209d727beebef93d399ff7669f7b7d6d2014d4b | PHP | yh-andrew/interview_api_assignment | /routes/web.php | UTF-8 | 3,370 | 2.734375 | 3 | [] | no_license | <?php
use Illuminate\Support\Facades\Route;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Hash;
Use App\Models\Account;
/*
|--------------------------------------------------------------------------
| Web Routes
|-----------------------------------------------... | true |
815b0b9afbceb68a280143bbaa1b682f3133e53b | PHP | nasslamenace/ProjetMalaisie | /EditProfile.php | UTF-8 | 3,090 | 2.671875 | 3 | [] | no_license |
<?php
session_start();
$error = array();
try
{
$bdd = new PDO('mysql:host=localhost;dbname=instrumentRental;charset=utf8', 'root', 'root', array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
if(isset($_POST['updateName']))
{
$statement = $bdd->prepare('UPDATE users SET username = :name WHER... | true |
e6242fb71ceb2daf0b50689337ce52325546f1d9 | PHP | fpiraneo/aletsch | /libs/credentialsHandler.php | UTF-8 | 3,473 | 2.578125 | 3 | [] | no_license | <?php
/*
* Copyright 2014 by Francesco PIRANEO G. (fpiraneo@gmail.com)
*
* This file is part of aletsch.
*
* aletsch is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or... | true |
87fccef757ddc15e4e2caed3c48019249d7db13d | PHP | HarrisonSong/Clickee | /application/models/booking_model.php | UTF-8 | 1,997 | 2.828125 | 3 | [] | no_license | <?
ini_set('date.timezone', 'Asia/Singapore');
class Booking {
private static $day_string = array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
var $id;
var $date;
var $start_at;
var $end_at;
var $user_id;
var $user_name;
var $room_id;
/*
function getDay() {
return Slot::$day_string[$this->day];
}*/
... | true |
6319578b2862538c4eff01062801dc04ba04993c | PHP | phan/phan | /tests/php72_files/src/0005_getenv.php | UTF-8 | 94 | 2.765625 | 3 | [
"Apache-2.0",
"ISC",
"BSD-3-Clause",
"MIT"
] | permissive | <?php
echo intdiv(getenv(), 2); // getenv with 0 params returns an array in php 7.1 and 7.2
| true |
2d7f1121cb830a21642687d5d22249d6af0b9724 | PHP | 1601com/custom-shop-php-sdk | /src/Model/ProductImage.php | UTF-8 | 1,674 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
/**
* This file is part of the Billbee Custom Shop API package.
*
* Copyright 2019 by Billbee GmbH
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*
* Created by Julian Finkler <julian@mintware.de>
*/
namespace Billbee\Custom... | true |
746447c20720f8a1bb0171628cdf055e2323784f | PHP | MariaEzquerra/formulary-plugin | /formulary-plugin.php | UTF-8 | 9,688 | 2.53125 | 3 | [] | no_license | <?php
/**
* Plugin Name: Formulary
* Author: Maria Ezquerra
* Description: Plugin zum Erhöhen eines Formulars mit einem Shortcode
* [formulary_plugin_form]
*/
register_activation_hook(__File__,'Formulary_Plugin_init');
function Formulary_Plugin_init()
{
global $wpdb;
$tabla_kunde = $wpdb->prefix . 'ku... | true |
4e4ef690b4d72acefa80780cb2d2f5f9b6621036 | PHP | thanhsbd/klf-tech-assessment | /index.php | UTF-8 | 1,152 | 2.78125 | 3 | [] | no_license | <?php
require "constants.inc";
require "common.php";
require "db.php";
//Set the current navigation based on the route
if (isset($_GET['route']) && !empty($_GET['route'])) {
//Explode the route to get the root (parent) view so that we can highlight that as the current page on the navigation
$route = explode('/', $_G... | true |
4e59a3e2845ff4c97b2496efa24a3b41e0f98a9a | PHP | weedkiller/CommonPlatform2 | /工具/Picturepark.SDK.Playground-master/Picturepark.SDK.Playground-master/src/Picturepark.SDK.Php/Picturepark/DocumentHistoryClient.php | UTF-8 | 3,049 | 2.9375 | 3 | [] | no_license | <?php
namespace Picturepark;
final class DocumentHistoryClient
{
/**
* @param \Microsoft\Rest\ClientInterface $_client
*/
public function __construct(\Microsoft\Rest\ClientInterface $_client)
{
$this->_Search_operation = $_client->createOperation('DocumentHistoryClient_Search');
$t... | true |
53714ea98aa8423f11c833f1f5a3898e25415ca5 | PHP | tiagovb/moip-php | /src/Moip/Environment.php | UTF-8 | 627 | 2.71875 | 3 | [] | no_license | <?php
class Moip_Environment
{
const ENVIRONMENT_DEV = 'development';
const ENVIRONMENT_PROD = 'production';
public static $environmentArgs = [
self::ENVIRONMENT_DEV => [
'name' => 'Sandbox',
'base_url' => 'https://desenvolvedor.moip.com.br/sandbox',
],
sel... | true |
e450fa8f19f722ef9f0bb9ab6e9e3cfd67c34743 | PHP | cptladouille/videatube | /model/themeManager.php | UTF-8 | 2,010 | 3.3125 | 3 | [] | no_license | <?php
require_once('model/model.php');
require_once('model/themeClass.php');
class themeManager extends Model
{
private $_db; // Instance de PDO.
public function __construct()
{
$this->setDb($this->connectBDD());
}
public function add(themeClas... | true |
919d19ed0a1bac403997fd03de366aa3cf8e667e | PHP | nitronet/ezormbundle | /ORM/Exception/QueryException.php | UTF-8 | 5,690 | 2.71875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace Nitronet\eZORMBundle\ORM\Exception;
use eZ\Publish\API\Repository\Values\Content\Content;
use eZ\Publish\API\Repository\Values\Content\ContentInfo;
use Nitronet\eZORMBundle\Exception;
use Nitronet\eZORMBundle\ORM\Query;
use Nitronet\eZORMBundle\ORM\TableInterface;
use eZ\Publish\API\Repository\Values\C... | true |
d39d4cf790a6d96ec8eb712460590b5acfa13c76 | PHP | MySocialApp/mysocialapp-php-client | /MySocialApp/Models/JSONable.php | UTF-8 | 5,165 | 2.984375 | 3 | [] | no_license | <?php
namespace MySocialApp\Models;
use MySocialApp\Services\Session;
/**
* Class JSONable
* @package MySocialApp\Models
*/
class JSONable {
/**
* @var Session
*/
protected $_session;
/**
* @param JSONableArray|JSONableMap|JSONable $jsonAble
* @return array|JSONable|null
*/
... | true |
1106294d9fd44be557a0763d929a6257db97080f | PHP | BouhouchJulien/phalcon-cloud | /app/controllers/DisquesController.php | UTF-8 | 1,185 | 2.71875 | 3 | [] | no_license | <?php
class DisquesController extends \DefaultController {
public function initialize(){
parent::initialize();
$this->model="Disque";
}
/**
* Affecte membre à membre les valeurs du tableau associatif $_POST aux membres de l'objet $object<br>
* Prévoir une sur-définition de la méthode pour l'affecta... | true |
1b1ab2c40553cfea9fd8f9de18136a8de63a668d | PHP | ryoichi-k/Task2 | /admin/Model/Room.php | UTF-8 | 9,726 | 2.75 | 3 | [] | no_license | <?php
class Room extends Model
{
//index.phpにて部屋情報表示
public function getRoom()
{
try {
$this->connect();
$sql = 'SELECT * FROM room WHERE delete_flg = 0';
$stmt = $this->dbh->query($sql);
return $stmt->fetchAll(PDO::FETCH_ASSOC);
} catch (Excep... | true |
4a03045d458ac784660e7f638e9766323b54c42b | PHP | BogdanBrizhaty/web-angular-test.simple | /www/App/Model/FilterArgs.php | UTF-8 | 1,514 | 3 | 3 | [] | no_license | <?php
class FilterArgs
{
// public $Model; // does it really neascecery?
public $Brand;
public $LowerPricePoint;
public $UpperPricePoint;
public $MinDisplaySize;
public $MaxDisplaySize;
public $MinRam;
public $MaxRam; ... | true |
4394abc3b3d5cac6d343f063fc3dbbd5cfb055ca | PHP | DaviCarbo/FinalPHPCourseProject | /ConnDb_project.php | UTF-8 | 1,236 | 3.046875 | 3 | [
"Apache-2.0"
] | permissive | <?php
declare(strict_types=1);
class ConnDb {
private $pdo;
public function __construct(PDO $pdo)
{
$this->pdo = $pdo;
}
public function getUser(PDO $pdo){
$sth=$pdo->prepare("SELECT * FROM users WHERE name = :name AND pwd = :pwd");
$sth->bindValue(':n... | true |
2d519afd7ebc79cad29511ac03939ba4164781e7 | PHP | floostudio/dinkes | /application/libraries/RL4A_reader.php | UTF-8 | 3,419 | 2.828125 | 3 | [] | no_license | <?php
/**
*
* Author Iqbal Permana
*/
class RL4A_reader{
private $CI ;
private $CHECKER_1 ;
private $CHECKER_2 ;
function __construct(){
$this->CI =& get_instance();
$this->CI->load->library('ExcelReader');
$this->CI->load->model('upload/m... | true |
b82ad38b412bfa303414ea6f72827ccca607dccd | PHP | Christiancembes/Hotel-Project | /plugins/learn/blogtesting/updates/builder_table_update_learn_blogtesting_genres.php | UTF-8 | 703 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php namespace Learn\Blogtesting\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateLearnBlogtestingGenres extends Migration
{
public function up()
{
Schema::rename('learn_blogtesting_genre', 'learn_blogtesting_genres');
Schema::table('learn_blogtesting_... | true |
0a73e860d8b52e6228de59785a9cf696f3080445 | PHP | delta/digitalfortress_13 | /pages/web/task4/requir/register.php | UTF-8 | 1,185 | 2.671875 | 3 | [] | no_license | <?php
if(isset($_REQUEST['submit'])){
include "config.php" ;
$user = mysql_real_escape_string($_REQUEST['user']);
$pass = mysql_real_escape_string($_REQUEST['password']);
$desc = mysql_real_escape_string($_REQUEST['company']);
$query = "SELECT * FROM `task4` WHERE `USER`='$user' AND `PASSWORD`='$pass' AND... | true |
36a1d443b51b54ff8e6c8f98b0e4b93d02b08294 | PHP | mofasserrkb/PHP-CODES | /ifelse.php | UTF-8 | 606 | 4.21875 | 4 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<title>if else statement </title>
</head>
<body>
<?php
/*
PHP - The if...else Statement
The if...else statement executes some code if a condition is true and another code if that condition is false.
Syntax
if (condition) {
code to be executed if condition is true;
} else {
code to be... | true |
56ed559b573cfb5db275fe5370f0e59523ca3c5a | PHP | muramura-cloud/bbs_ver2 | /lib/Storage/Database.php | UTF-8 | 1,655 | 2.953125 | 3 | [] | no_license | <?php
// 何が保証されているのかというと、データベースの接続設定を入手して、データベースに接続(データベースハンドラを用意)すること。
// 言い換えると、データベースを操作するクラスは必ず、データベースの接続情報を取得してデータベースに接続するという仕事を必ず所有している。だから、ここの定義する。
abstract class Storage_Database
{
protected $dbh = null;
protected $config = [
'host' => '127.0.0.1',
'port' => '',
'name' ... | true |
c5acab4a63ec7829dcc5469c6841328164e42c36 | PHP | ivorobioff/thesinglequote | /src/Core/Agent/Entities/Agent.php | UTF-8 | 856 | 2.71875 | 3 | [] | no_license | <?php
namespace ImmediateSolutions\Core\Agent\Entities;
use ImmediateSolutions\Core\User\Entities\User;
/**
* @author Igor Vorobiov<igor.vorobioff@gmail.com>
*/
class Agent extends User
{
/**
* @var string
*/
private $email;
public function getEmail() { return $this->email; }
public functi... | true |
ddfff891d6865cdbdae5621ff112ab5b0e292a2a | PHP | mdabrowski9/cinkciarzpay_drupal8 | /commerce_conotoxia_pay/src/ConotoxiaPaySDK/src/Cryptography/BigInteger/Compare/CompareInterface.php | UTF-8 | 283 | 2.59375 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace CKPL\Pay\Cryptography\BigInteger\Compare;
/**
* Interface CompareInterface.
*
* @package CKPL\Pay\Cryptography\BigInteger\Compare
*/
interface CompareInterface
{
/**
* @return int
*/
public function perform(): int;
}
| true |
69e18ec827457f72dbdff852b27cdb7378abe486 | PHP | iberescu/p2 | /libs/class.View.php | UTF-8 | 903 | 2.875 | 3 | [] | no_license | <?php
class View {
public $data = array();
public function __construct()
{
}
private function loadView($name)
{
if (file_exists(APPLICATION_VIEW_PATH . $name . '.tpl'))
{
require_once(APPLICATION_VIEW_PATH . $name . '.tpl');
}
else {
echo 'View file not found: '.$name;
exit;
}
return $th... | true |
4182e40a95b5869f27133000e3f4f8ff268712bd | PHP | emmanuelgamboa09/Decryptoid | /decryptoid.php | UTF-8 | 3,675 | 2.75 | 3 | [] | no_license | <?php
require_once 'login.php';
$conn = new mysqli($hn, $un, $pw, $db);
if ($conn->connect_error)
die("OOPS");
echo <<<_END
<html><head><title>DECTRYPTOID</title></head><body>
<form method='post' action='decryptoid.php' enctype='multipart/form-data'><pre>
Select File or input text into the box:
<input ... | true |
2d6ac997bc01cf85c83c2b3bb215f48b3e21de9a | PHP | hakaigod/apcom | /src/Model/Entity/TfImi.php | UTF-8 | 1,900 | 2.65625 | 3 | [] | no_license | <?php
namespace App\Model\Entity;
use App\Model\Table\TfImiTable;
use Cake\ORM\Entity;
/**
* TfImi Entity
*
* @property int $imicode
* @property int $exanum
* @property int $strategy_imisum
* @property int $technology_imisum
* @property int $management_imisum
* @property int $imipepnum
* @property \Cake\I18n... | true |
5b588d8c32a1103dd7a17643c42d34abee4e2ca5 | PHP | Astrotomic/laravel-transaction-proxy | /src/TransactionProxy.php | UTF-8 | 450 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace Astrotomic\LaravelTransactionProxy;
use Illuminate\Support\Facades\DB;
class TransactionProxy
{
protected object $object;
/**
* @param object $object
*/
public function __construct($object)
{
$this->object = $object;
}
public function __call(string $name, a... | true |
38f7e6e4bcbe9af6163285b7d58299c0a1c4fb9e | PHP | EpicArtz08999/BlockSniper | /src/Sandertv/BlockSniper/brush/BaseType.php | UTF-8 | 697 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace Sandertv\BlockSniper\brush;
use Sandertv\BlockSniper\Loader;
abstract class BaseType {
const MAX_WORLD_HEIGHT = 256;
const MIN_WORLD_HEIGHT = 0;
const TYPE_OVERLAY = 1;
const TYPE_LAYER = 2, TYPE_FLAT_LAYER = 2;
const TYPE_REPLACE = 3;
const TYPE_FLATTEN = 4, TYPE_EQUALIZE = 4;
const TYPE_DR... | true |
16689aff508dbcb8d9e45fbbe0b2ba6bdcc2573c | PHP | taniapujol/curs2018 | /PHP/Bibiloteca/php/servicios/enviarEmail.php | UTF-8 | 2,831 | 2.859375 | 3 | [] | no_license | <?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
//Para comprobar si se recibe un post desde un ajax
if ($_SERVER['REQUEST_METHOD']==='POST'){
//Para almacenar los datos JSON recibidos en una variable
$request= file_get_contents('php://input');
//Para convertir un Json en un array de php
... | true |
e7d13a66404a4140bf2c62ece34ca01de3bd074d | PHP | smlling/zhuyin-server | /app/api/service/System.php | UTF-8 | 2,140 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace app\api\service;
use app\api\model\SystemCounter;
class System {
/**
* 获取用户相关计数器
* @author lwtting <smlling@hotmail.com>
* @return array
*/
public function userCounter () {
return [
'available' => (SystemCounter::get(SystemCounter::USER_AVAILABLE_COU... | true |
7d62c1bcb2f5cb09d5734ba08a8a24c2df949630 | PHP | liuxiqian/english_online_study | /Application/StudentWordReviewNodeAll/Model/StudentWordReviewNodeAllModel.class.php | UTF-8 | 1,889 | 2.859375 | 3 | [] | no_license | <?php
namespace StudentWordReviewNodeAll\Model;
use think\Model;
use Home\Model\Word;
/**
* 学生学习所有单词时的学习节点,每个学生只记录一条信息。
*/
class StudentWordReviewNodeAllModel extends Model
{
/**
* 设置正在学习的单词
* @param int $wordId 单词id
* @param int $studentId 学生id
* ... | true |
b5f5293f9308050ff6a09106d3637547b19abe3a | PHP | paulosales/algorithms-and-datastructure-php | /tests/Math/Sqrt/AlexandriaHeronMethodTest.php | UTF-8 | 463 | 2.890625 | 3 | [
"MIT"
] | permissive | <?php
namespace Math\Sqrt;
use PHPUnit\Framework\TestCase;
use Math\Sqrt\AlexandriaHeronMethod;
final class AlexandriaHeronMethodTest extends TestCase {
public function testSqrt() {
$this->assertEquals("2.000", sprintf("%0.3f", AlexandriaHeronMethod::squareRoot(4)));
$this->assertEquals("4.000", sprintf("%... | true |
b66647f5c30216b75b6f6032aaa93f9498baf6be | PHP | hanxiaoqing123/wxoffical | /group/mgroup.php | UTF-8 | 973 | 2.625 | 3 | [] | no_license | <?php
header("Content-Type:text/html;charset=utf-8");
//这个文件里用来修改组名
//包含函数库文件,有三个函数可以使用
include "../fc.php";
//如果用户提交了
if(isset($_POST['dosubmit'])) {
//access_token
$access_token = get_token();
//修改url
$url = "https://api.weixin.qq.com/cgi-bin/groups/update?access_token={$access_token}";
//post传... | true |
b0809a516d4f85b376da046bb88db699aef2db3d | PHP | ludoliv/projet_olympiadeSI1A12B | /BD/Classe/Jury.php | UTF-8 | 663 | 3.09375 | 3 | [] | no_license | <?php
class Jury{
private $_NumJury;
private $_Login;
private $_Password;
public function __construct($id,$login,$pass)
{
$this->_NumJury = $id;
$this->_Login = $login;
$this->_Password = $pass;
}
public function getNumJury(){
return $this... | true |
a63c7be0824c690d72a7d999c3b8a943ed9a5693 | PHP | AlexisFioreCode/BankProjectphp | /singleaccount.php | UTF-8 | 591 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
require "model/operationManager.php";
require "model/accountManager.php";
require "model/entity/Account.php";
require "model/entity/Operation.php";
$accountModel = new AccountManager();
$operationModel = new OperationManager();
if(isset($_GET["index"]) && !empty($_GET["index"])) {
$account = $... | true |
cd32058942d62b4966aa8fd4f10e569dc8b6ce8f | PHP | GilbertoGiro/Adventurer | /app/Utilities/Address.php | UTF-8 | 677 | 3.21875 | 3 | [] | no_license | <?php
namespace App\Utilities;
class Address
{
/**
* Method to get Formatted Address
*
* @param $event
* @return string
*/
public static function address($event)
{
$address = ($event->endereco) ? $event->endereco : 'Av. União dos Ferroviários';
$number = ($event->n... | true |
2daecbdf0a8ad525697dcbc631e9e8b41590baff | PHP | azusa1115/MAMP | /htdocs/portfolio/check_sb.php | UTF-8 | 2,651 | 2.609375 | 3 | [] | no_license | <?php require('dbconnect.php'); ?>
<?php
$softbanks = $db->prepare('SELECT * FROM softbank WHERE id=?');
$softbanks->execute(array($_POST['plan']));
$softbank = $softbanks->fetch();
$total_price = 0;
$plan_price = $softbank['price'];
$total_price += $plan_price;
$tel_flag = 0;
$tel_price = 0;
if( $_POST['tel'] == '... | true |
5ddab8a16ec0490b139152c9c6544d475e15b532 | PHP | MuraliHamsa/meddcloud | /app/Models/UserGroup.php | UTF-8 | 726 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Illuminate\Foundation\Auth\User as Authenticatable;
class UserGroup extends Authenticatable
{
protected $table = 'user_groups';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'user_id', 'group_id'
]... | true |
fc5a661e2dcb414648e351e5dde40d6bbe77bbc4 | PHP | sasfeld/Jumpup | /de.bht.fb6.mme2.mfg/module/JumpUpUser/src/JumpUpUser/Controller/ANeedsAuthenticationController.php | UTF-8 | 3,775 | 2.625 | 3 | [] | no_license | <?php
namespace JumpUpUser\Controller;
use \JumpUpUser\Util\Auth\CheckAuthentication;
use \JumpUpUser\Export\IAuthenticationRequired;
use \Zend\Mvc\Controller\AbstractActionController;
use JumpUpUser\Util\Messages\IControllerMessages;
use JumpUpUser\Util\Routes\IRouteStore;
use JumpUpUser\Models\User;
use JumpUpUser\U... | true |
743eecd4aabaa02204290bcd094697a509208b11 | PHP | play-area/stock-watch | /app/model/AdminUpdateCalculations.php | UTF-8 | 13,738 | 2.5625 | 3 | [] | no_license | <?php
/** Defining Querries */
define('DATE_LIST_FULL_QUERY', 'SELECT dc1.symbol, dc1.recorddate, dc1.open,dc1.high,dc1.low,dc1.close,dc1.volume FROM data_quandl_daily_liquid_options AS dc1 INNER JOIN(SELECT DISTINCT recorddate FROM data_quandl_daily_liquid_options ORDER BY recorddate desc limit ?) as dc2 ON dc1.recor... | true |
817147d4ac18e5f7fc2d3c79a4526d515632869d | PHP | Boy0704/e_pos | /application/views/laporan/cetak_penjualan_item.php | UTF-8 | 1,782 | 2.671875 | 3 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<title></title>
<base href="<?php echo base_url() ?>">
<link rel="stylesheet" href="assets/bower_components/bootstrap/dist/css/bootstrap.min.css">
</head>
<body onload="print()">
<center>
<h4>LAPORAN PENJUALAN ITEM</h4>
</center>
<table class="table">
<tr>
<td>Barcode</td>
... | true |
ebe9e297d33ca936a9fc1b492bb10ab824ca7c47 | PHP | setogawamasao/security-bible | /4f/4f-021.php | UTF-8 | 361 | 2.546875 | 3 | [] | no_license | <body><?php
$user = $_GET["user"];
if ($user === "tanaka" || $user === "yamada") {
session_start();
session_regenerate_id(true);
$_SESSION["user"] = $user;
echo "ログインしました(" . htmlspecialchars($user) . ")<br>";
echo '<a href="4f-022.php">マイページ</a><br>';
} else {
echo "ユーザ名が違います";
}
?>
</body>
| true |
529291122315fab4af545121947aafc8dee4df2b | PHP | zer0-framework/core | /src/Zer0/Brokers/Base.php | UTF-8 | 2,278 | 2.84375 | 3 | [] | no_license | <?php
namespace Zer0\Brokers;
use PHPDaemon\Core\ClassFinder;
use Zer0\App;
use Zer0\Config\Inline;
use Zer0\Config\Interfaces\ConfigInterface;
/**
* Class Base
* @package Zer0\Brokers
*/
abstract class Base
{
/**
* @var App
*/
protected $app;
/**
* @var array
*/
protected $in... | true |
0fc144efe9d78b7cbb20d8dba1f0fa9a02f075d9 | PHP | phpManufaktur/kfCommandCollection | /Data/Comments/Import/FeedbackModule.php | UTF-8 | 2,149 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
/**
* CommandCollection
*
* @author Team phpManufaktur <team@phpmanufaktur.de>
* @link https://kit2.phpmanufaktur.de/CommandCollection
* @copyright 2013 Ralf Hertsch <ralf.hertsch@phpmanufaktur.de>
* @license MIT License (MIT) http://www.opensource.org/licenses/MIT
*/
namespace phpManufaktur\CommandColle... | true |
4546e1ac50eac95670dc99f58da462a230fb9846 | PHP | edwinkepler/beats-and-pieces | /Exercism/php/bob/bob.php | UTF-8 | 1,231 | 3.65625 | 4 | [] | no_license | <?php
class Bob
{
public function respondTo(string $_s): string
{
// Get rid of whitespaces
$_s = preg_replace('/\s+/', '', $_s);
// check if all chars are uppercase (shouting)
$shouting = true;
for ($i = 0; $i < strlen($_s); $i++) {
if (ctype_lower($_s[$i]))... | true |
260b014a08120da6028a2dc51f9565688fc6359e | PHP | NeverMoreShadowFiend/serv_source_sanguomobile2 | /app/models/PlayerMission.php | UTF-8 | 26,209 | 2.84375 | 3 | [] | no_license | <?php
/**
* player_task 表 && 主线任务和每日任务逻辑
*/
class PlayerMission extends ModelBase{
const START = 0;//接任务
const COMPLETE = 1;//完成任务
const FINISH = 2;//领完奖,结束任务
const TOTAL_FINISH = 3;//所有主线任务做完
const DAILY_EXPIRE = 4;//每日任务过期失效
const MAX_DAILY_MISSION =... | true |