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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
c35c544857471b7b41c822381635c9b949786d46 | PHP | GetResponse/sdk-php | /src/Operation/RssNewsletters/Statistics/GetRssNewslettersStatistics/GetRssNewslettersStatisticsSearchQuery.php | UTF-8 | 1,949 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace Getresponse\Sdk\Operation\RssNewsletters\Statistics\GetRssNewslettersStatistics;
use Getresponse\Sdk\Client\Operation\DateRangeSearch;
use Getresponse\Sdk\Client\Operation\SearchQuery;
class GetRssNewslettersStatisticsSearchQuery extends SearchQuery
{
/**
* @return array
*/
public fu... | true |
891dfbf5f71c66c9316bc24f4194ab23a43f4afc | PHP | rodskin/blank-theme-wordpress-grid-bootstrap4 | /inc/theme-functions.php | UTF-8 | 7,771 | 2.890625 | 3 | [] | no_license | <?php
/**
* Navigation
*/
function menu_nav() {
wp_nav_menu(
[
'theme_location' => 'header-menu',
'menu' => '',
'container' => false,
'container_class' => false,
'container_id' => false,
'menu_class' => '',
'menu_id' => false,
'echo' => true,
... | true |
5a302588a61047d30737225ce2ee62d83afacc64 | PHP | DevAhmed15/Sample-Hotel | /classes/reservation.php | UTF-8 | 4,341 | 2.921875 | 3 | [] | no_license | <?php
include_once ('DBManager.php');
class reservation {
private $Start_Date;
private $End_Date;
private $Period;
private $price;
//setters
public function setCapacity($capac)
{
$this->capacity=$capac;
}
public function setStartDate($date)
{
$... | true |
fb81c78e15bad58367d4670508f61851d5239cca | PHP | Larivelsa/PHP_Training | /repeticoes/foreach.php | UTF-8 | 640 | 4.21875 | 4 | [] | no_license | <div class="titulo">Foreach</div>
<?php
$array=['a'=>"domingo","segunda","terça",
"quarta","quinta","sexta","sábado"];
foreach ($array as $valor)
echo "$valor <br>";
echo "<hr>";
foreach ($array as $indice=>$valor)
echo "$indice => $valor <br>";
echo "<hr>";
... | true |
73a7bed560edc35a80a30f8ba79b297ca376bee4 | PHP | zoontao/school | /src/App/Oauth/Service.php | UTF-8 | 5,671 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of the ZXT.
*
* (c) bell <bell@microlinkiot.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace UnionSchool\App\Oauth;
use UnionSchool\Common\Exceptions\Exception;
use UnionSchool\App\Common;
use UnionSc... | true |
07cea45f3f946ff48a31deb37d5e7a9f260ad980 | PHP | johnpleung/facebook-thing | /app/classes/enum-metric.php | UTF-8 | 2,040 | 2.90625 | 3 | [] | no_license | <?php
class enum_metric extends metric_base {
private $enums_definition;
private $data;
private $required_columns;
public function __construct($properties = null){
if(isset($properties['name'])){
$this->name = $properties['name'];
}
if(isset($properties['path'])){
$this->path = $properties[... | true |
a16524a34d4e2fce9e8f184f2aaabe9ec6328d01 | PHP | Yusuke-Suzuki-11/laravel_with_gym | /app/Helpers/PracticeHelper.php | UTF-8 | 366 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Helpers;
use Carbon\Carbon;
class PracticeHelper extends Helper
{
public static function test()
{
$dt = Carbon::createFromDate();
$dt->startOfMonth();
$dt->timezone = 'Asia/Tokyo'; //日本時刻で表示
echo $dt;
$headings = ['Monday','Tuesday','Wednesday','Thursday','Friday','Saterday','Sund... | true |
7f2f3d1f43e9d5a8784ac2f56ba2fe729892b09c | PHP | chokingwin/MTShop-REST-API | /application/api/service/Token.php | UTF-8 | 3,405 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace app\api\service;
use app\lib\enum\ScopeEnum;
use app\lib\exception\ForbiddenException;
use app\lib\exception\TokenException;
use think\Cache;
use think\Exception;
use think\Request;
class Token
{
public static function generateToken()
{
// 32个字符组成一组随机字符串
$randChars = getRandC... | true |
3b8fb7508eb9f036b5e23d0185003af1a9b6a8a4 | PHP | Mlapalus/mysite | /mysite-backend/domain/src/Gateway/ExperienceGatewayInterface.php | UTF-8 | 372 | 2.65625 | 3 | [] | no_license | <?php
namespace MySite\Domain\Gateway;
use MySite\Domain\Model\Experience;
use Ramsey\Uuid\UuidInterface;
interface ExperienceGatewayInterface
{
public function save(Experience $experience): void;
public function getExperienceById(UuidInterface $id): Experience;
public function update(Experience $experie... | true |
f07bb985bb5189b7d0ce64d86d70857fa9ecdc10 | PHP | NasifNoor/Get-Fresh-Laravel- | /app/Http/Controllers/HomeController.php | UTF-8 | 2,902 | 2.546875 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use App\Customer;
use Validator;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class HomeController extends Controller
{
public function index(){
return view('Home.index');
}
//Customer Login
/*public function customerLogin(){
return view(... | true |
9c8c6253a884feaada4bc062cd4766c904ee7efe | PHP | typicalcoda/veurux | /app/Client.php | UTF-8 | 510 | 2.640625 | 3 | [] | no_license | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Client extends Model
{
protected $guarded = ['id'];
protected $dates = ['dob'];
public function pickups(){
$this->hasMany('\App\Pickup');
}
public function setDobAttribute($date){
$d = date_create_from_format('d/m/Y',$date);
... | true |
ad70614cd3df7d1967dce8c800f0c9826d18ada4 | PHP | jlawrence11/lw | /setup_helpers/users_db.php | UTF-8 | 1,796 | 2.625 | 3 | [] | no_license | <?php
/**
* Set up the user's table and admin user
*
* This file will create a new table for users, using the variables
* following this comment block will also create a user for admin purpose
* DELETE this off the server RIGHT after you run it.
*
* @author Jon Lawrence <jlawrence11@gmail.com>
* @package LW_FW
... | true |
d3a5ef19abf589edb09b768a9fa5c1e4c3392afd | PHP | akagane99/csnc | /html/webapp/modules/quiz/action/edit/quiz/status/Status.class.php | UTF-8 | 957 | 2.640625 | 3 | [
"BSD-2-Clause"
] | permissive | <?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* 状態フラグ更新アクションクラス
*
* @package NetCommons
* @author Noriko Arai,Ryuji Masukawa
* @copyright 2006-2007 NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
* @project NetCommons Project... | true |
1cba65d851ca01b2ef7036ab22ad9f196764bc1a | PHP | Sentegrity/sentegrity-webservice | /src/symfony/src/Sentegrity/BusinessBundle/Handlers/Utility.php | UTF-8 | 2,695 | 3.140625 | 3 | [] | no_license | <?php
namespace Sentegrity\BusinessBundle\Handlers;
class Utility
{
/**
* Calculates average from given data set and returns a result in
* a given precision.
*
* @param array $bucket
* @param $precision
* @return float
*/
public static function calculateAverage(array $bucket... | true |
c880f3f52d27caf40cb083c497c6df0bd56fab78 | PHP | alexanderplattz/again_new | /new/system/core/Event.php | UTF-8 | 801 | 2.546875 | 3 | [] | no_license | <?php
define('J_EVENT_RESPONSE_START', 'J_EVENT_RESPONSE_START');
define('J_EVENT_RESPONSE_END', 'J_EVENT_RESPONSE_END');
define('J_EVENT_SHUTDOWN', 'J_EVENT_SHUTDOWN');
//TODO: Create and apply more events..
class Event
{
private static $events = array();
public static function listen($name, $callback)
{
stat... | true |
b3091c1ec72f0d3845014c9fb800f5f695c35a4b | PHP | Poojan-Mehta/Codeigniter_3 | /application/models/Country_model.php | UTF-8 | 704 | 2.546875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
class Country_model extends CI_model{
function getCountry()
{
$this->db->select('*');
$this->db->from('country');
$query = $this->db->get();
$data = $query->result_array();
return $data;
}
function getState($country_id)
{
$this->db->select('*');
$this->db->from('state');
$this->db->wher... | true |
9002b73d247f9a983521197a1d3fe45e09a06de1 | PHP | davidkyalo/TeaPress | /src/Contracts/Utils/ThrowsException.php | UTF-8 | 180 | 2.75 | 3 | [] | no_license | <?php
namespace TeaPress\Contracts\Utils;
interface ThrowsException
{
/**
* Throw the exception
*
* @return void
*
* @throws \Throwable
*/
public function throw();
} | true |
66f449931461178645c585cecd07b63001379cfb | PHP | DanielRMiller/cs313-php | /smartCart/recipeFormHandler.php | UTF-8 | 2,479 | 2.859375 | 3 | [] | no_license | <?php
session_start();
include 'dbConnect.php';
$stmt = $db->prepare("
SELECT name
FROM recipe
WHERE name=:name
");
$name = $_POST['recipeName'];
$stmt->execute(array(':name' => $name));
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
if (!empty($results)) {
header("Location: recipeForm.... | true |
1d5ddcb09265f10f246d1fae6975c4e76df0e005 | PHP | Ziolang/cs313 | /web/week05/createdunit.php | UTF-8 | 4,936 | 2.609375 | 3 | [] | no_license | <?php include "connect.php";
$db = connect();
$name = $_POST['name'];
$class = $_POST['class'];
$aa = $_POST['aa'];
$lvl = 1;
$exp = 0;
$hp = 25; $mp = 15; $atk = 4; $def = 3; $int = 2;
$spr = 2; $move = 3; $crit = 2; $eva = 2;
if ($_POST['stats'] == "ra"){
$hp = 20;
$mp = 20;
$atk = 4;
$def = ... | true |
8a74a287f9732fbebdf7039cf82134fbf7d8bac7 | PHP | kellerflint/OpenProgression | /app/private/auth_functions.php | UTF-8 | 1,194 | 2.640625 | 3 | [] | no_license | <?php
define("USR", "user");
define("ADM", "admin");
define("OWN", "owner");
define("CREATOR", "creator");
function log_in($user, $permission)
{
session_regenerate_id();
$_SESSION['user_id'] = $user['user_id'];
$_SESSION['last_login'] = time();
$_SESSION['user_name'] = $user['user_name'];
$_SESSI... | true |
ea1cf444e8d601fb5a58c50f92fe49a22776b2de | PHP | StyxOfDynamite/training | /src/Game/Players/Computer.php | UTF-8 | 737 | 3.109375 | 3 | [] | no_license | <?php
namespace App\Game\Players;
use App\Game\Moves\MoveFactoryInterface;
/**
* This class represnts a computer player.
* It is hardcoded to instansiate an player isntance with the name Computer.
* It is forced to implement the abstract method chooseMove().
*/
class Computer extends Player
{
/**
* Crea... | true |
3791e99130f010bab1087259d0c27a1a867b83a4 | PHP | kdrmlhcn/YandexTranslateAPI | /src/translate.php | UTF-8 | 1,175 | 2.9375 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: melihcan
* Date: 2019-04-17
* Time: 10:01
*/
namespace TranslateAPI;
class translate implements translateInterface
{
/**
* @var string
*/
public $url = "https://translate.yandex.net/api/v1.5/tr/translate";
/**
* translate constructor.
* @... | true |
210511e022331e99a7372a82e8f0b25e34f930c7 | PHP | chaudhary4k4/mycollab3 | /activecollab/4.2.3/angie/frameworks/comments/models/IncomingMailCommentAction.class.php | UTF-8 | 5,204 | 2.515625 | 3 | [] | no_license | <?php
/**
* Incoming mail action - Add comment
*
* @package angie.framework.email
* @subpackage models.incoming_mail_actions
*
*/
class IncomingMailCommentAction extends IncomingMailProjectObjectAction {
const ADD_ON_TASK = 'task';
const ADD_ON_DISCUSSION = 'discussion';
const ADD... | true |
dec071fb4af4b75773f3ddcd60cdbd4b951fd770 | PHP | phpbrew/phpbrew | /tests/PhpBrew/CommandBuilderTest.php | UTF-8 | 2,493 | 2.59375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
namespace PhpBrew\Tests;
use PhpBrew\CommandBuilder;
use PHPUnit\Framework\TestCase;
/**
* @small
*/
class CommandBuilderTest extends TestCase
{
public function test()
{
ob_start();
$cmd = new CommandBuilder('ls');
$this->assertEquals(0, $cmd->execute());
ob_end_clean(... | true |
4289d02a2a2d03d60590600fc06ba6adeccdf605 | PHP | M1nified/wp-plugin-sketch | /Class/DB.php | UTF-8 | 489 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php namespace wp_plugin_sketch;
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
class DB
{
private $db;
const TABLE_NAMES = [
'table_1',
'table_2'
];
private $tableNames = null;
function __constructor()
{
global $wpdb;
$this->db = $wpdb;
... | true |
e5d70f8fb96c98fdba6f59aaa94e4c04f47034e0 | PHP | Japsiee/Unreal-Vending-Machine | /core/classes/Users.view.php | UTF-8 | 1,525 | 2.796875 | 3 | [] | no_license | <?php
include_once 'Users.model.php';
class UsersView extends UsersModel {
// LOGIN VIEW
public function userloginview($username, $password) {
$loginverify = $this->userloginmodel($username, $password);
if (!$loginverify) {
echo "<h2 style='text-align:center; margin-top: 40px;'>User doesnt exist</h... | true |
f76b20cba36f1f35a7f80dfb0d933666b68bd8c3 | PHP | fengshuang110/api-skeleton | /Application/Model/SectionQuestion.php | UTF-8 | 357 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace Application\Model;
use Illuminate\Database\Eloquent\Model;
class SectionQuestion extends Model{
protected $table = 'section_question';
protected $primaryKey = "question_id";
public function __construct(){
Connection::init();
}
public function section(){
return $this->hasOne('Section', '... | true |
faefea3861c6ac0ab1eb63e6ad081c7fa70c9fc0 | PHP | lenochware/padmin | /controllers/LookupsController.php | UTF-8 | 3,232 | 2.578125 | 3 | [] | no_license | <?php
include 'BaseController.php';
class LookupsController extends BaseController {
function indexAction() {
$this->title(1, 'Číselníky');
$lookups = new PCGrid('tpl/lookups/list.tpl');
$lookups->setquery('select distinct CNAME from LOOKUPS');
return $lookups;
}
function viewAction($lookup) {
$this->title... | true |
b8c51f678769539d5dd1a9869017fe04cbbde6ca | PHP | zordius/HandlebarsTest | /inc/cache/__Mustache_3281cb13186127e9397a8b20854bbbc3.php | UTF-8 | 6,045 | 2.640625 | 3 | [] | no_license | <?php
class __Mustache_3281cb13186127e9397a8b20854bbbc3 extends Mustache_Template
{
private $lambdaHelper;
public function renderInternal(Mustache_Context $context, $indent = '')
{
$this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context);
$buffer = '';
$buffer .=... | true |
71bb4bd42e1484b17e41526118da1d51b5652304 | PHP | faille76/netcms | /src/Contact/Application/Command/SendEmailCommand.php | UTF-8 | 997 | 2.9375 | 3 | [
"0BSD",
"BSD-3-Clause"
] | permissive | <?php
declare(strict_types=1);
namespace App\Contact\Application\Command;
use App\Shared\Application\Command\AbstractCommand;
final class SendEmailCommand extends AbstractCommand
{
private string $from;
private string $subject;
private string $email;
private string $content;
public function __c... | true |
e99bb2f8851b8ce409a3a9138a704a8edd8cbffe | PHP | muhammad-habib/Import-massive-excel-sheet | /app/Repository/RepositoryInterface.php | UTF-8 | 490 | 3.125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Repository;
interface RepositoryInterface
{
/**
* Function returns all data from DB
*/
public function findAll(array $columns = ['*']);
/**
* Creates new record in DB
*/
public function create(array $data);
/**
* Updates record in DB
*/
publ... | true |
302bc74f9038d8a7ec13f7ad94aa3a5065ba8347 | PHP | gonulkilic/SoftwareDevelopmentProject-with-Documentation | /682/technician/building/addBuildingUsername.php | UTF-8 | 667 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
require("../../login/connection.php");
$id = $_GET["id"];
$name = $_GET["name"];
$manager = $_GET["username"];
$technician = $_POST["technician"];
$sql = "INSERT INTO building(id, name, manager, technician) VALUES (:id, :name, :manager, :technician)";
$stmt = $conn -> prepare($sq... | true |
3bf25cd0fa1f1bdd86b91eb4102759d3f53e2c2a | PHP | tb2021-2-d-h/tech-base | /1-18.php | UTF-8 | 281 | 2.671875 | 3 | [] | no_license | <?php
for ($i=1; $i<=100; $i++) {
echo $i, ". おはよう!今日も君が好きだよ。夜は大好物のクリームシチューを作って待ってるからね。遅くならないで定時で帰って来るんだよ。いいね?返事は?", "<br>";
}
?> | true |
ac185d8f42a0c8de36ff62e2776dbdd047faad1e | PHP | reishou/unique-identity | /tests/Models/User.php | UTF-8 | 423 | 2.5625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
namespace Reishou\UniqueIdentity\Tests\Models;
use Illuminate\Database\Eloquent\Model;
use Reishou\UniqueIdentity\HasUid;
/**
* Class User
*
* @property int $id
* @property string $name
* @method static Model|User create($attributes)
* @package Reishou\Uid\Tests\Models
*/
class User extends Model
{
... | true |
2afef7b118e0b02d2cffa4ebef54219aa01644ad | PHP | andersonlop/CursoPHP7 | /Rename/exemplo-01.php | UTF-8 | 612 | 3.296875 | 3 | [
"MIT"
] | permissive | <?php
$dir1 = "folder_01";
$dir2 = "folder_02";
//Criando Pastas(diretórios)
if (!is_dir($dir1)) mkdir($dir1);
if (!is_dir($dir2)) mkdir($dir2);
//Criando um arquivo dentro da pasta folder_01
$filename = "README.txt";
if (!file_exists($dir1 . DIRECTORY_SEPARATOR . $filename)){
$file = fopen($dir1 . DIRECTORY_SE... | true |
d8c3f6fb79b9494174ed375e2bd09a04c981f84c | PHP | photoup-godwinh/vwrap | /example/example1.php | UTF-8 | 635 | 3.140625 | 3 | [] | no_license | <?php
require '../vendor/autoload.php';
use SimplePhp\Validator;
use Respect\Validation\Validator as v;
// CASE1: 1 input; 1 rule
$input = 'abc';
$rule = v::alnum()->setName('First name');
//$rule = v::alnum()->noWhitespace()->length(1, 15)->setName('First name');
echo "<p>This show a single input and single rule va... | true |
c7ca99f47a54b54514ca600f45e6bad4b7ae2bf3 | PHP | ARCANESOFT/Blog | /src/Bases/Migration.php | UTF-8 | 680 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php namespace Arcanesoft\Blog\Bases;
use Arcanedev\Support\Database\Migration as BaseMigration;
/**
* Class Migration
*
* @package Arcanesoft\Blog\Bases
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
*/
abstract class Migration extends BaseMigration
{
/* --------------------------------------------... | true |
7e483fc7a6c2cfd24a05882f6a1e77aba095528e | PHP | LittleGeorgeWatchingStar/Rialto2020 | /src/Rialto/Purchasing/Invoice/Reader/Email/AttachmentLocatorAttachment.php | UTF-8 | 4,256 | 2.640625 | 3 | [] | no_license | <?php
namespace Rialto\Purchasing\Invoice\Reader\Email;
use RecursiveIteratorIterator;
use Rialto\Purchasing\Invoice\SupplierInvoiceFilesystem;
use Rialto\Purchasing\Invoice\SupplierInvoicePattern;
use Rialto\Purchasing\Supplier\Supplier;
use Zend\Mail\Storage\Part\PartInterface;
use Zend\Mime\Mime;
/**
* Gets the ... | true |
4894b961a9bcce141b7c4cbf297a71acd8fdf1a2 | PHP | googleapis/google-api-php-client-services | /src/DataprocMetastore/Resource/ProjectsLocationsServicesMetadataImports.php | UTF-8 | 7,082 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | <?php
/*
* Copyright 2014 Google Inc.
*
* 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 applicable law or agreed t... | true |
5324fb9b626ef778bdcb91a815030a9d2f35a4fb | PHP | vsarapin/Web-Matcha | /server/application/models/SaveMessagesCounter.php | UTF-8 | 1,533 | 2.515625 | 3 | [] | no_license | <?php
namespace application\models;
use application\core\base\Model;
class SaveMessagesCounter extends Model {
public function saveUsersMessages($login, $hisLogin) {
if (empty($login) || empty($hisLogin)) {
exit;
}
$login = json_decode(JWT::decode($login, "MOXghJK2dJ"), true);
$this->table = "likes";
... | true |
1691e32c481a04fdf7498268ccf888bf6fab133a | PHP | agnesQ/Create-Your-Own-Drink | /changesetting.php | UTF-8 | 3,924 | 2.75 | 3 | [] | no_license | <?php
include 'header.php';
if(!$uid_isset || !$uid_isvalid) {
// access database and posted data
$link = <<<EOD
<a href="/create_your_own_drink/login.php">Please first log in :)</a>
EOD;
echo $link;
}
else {
if($_SERVER['REQUEST_METHOD'] != 'POST') {
... | true |
a017c99b05df1a840b678ee2d3538a4d8bd2aa19 | PHP | aminkt/travelagency | /core/rest/versions/v1/controllers/HomeController.php | UTF-8 | 2,255 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace rest\versions\v1\controllers;
use aminkt\yii2\rest\controllers\RestControllerTrait;
use aminkt\yii2\rest\utils\HttpCode;
use common\models\Game;
use rest\models\LoginForm;
use rest\models\SignupForm;
use yii\rest\Controller;
use yii\web\BadRequestHttpException;
/**
* Class HomeController
*
* @pack... | true |
da3ea2a28ae032045df383f25980f09a1b505c92 | PHP | niahoo/micromachine | /src/micromachine/utils.php | UTF-8 | 4,178 | 2.6875 | 3 | [] | no_license | <?php
//@todo classer les fonctions
function attr_getter($attr_name) {
return function ($object) use ($attr_name) {
return $object->$attr_name;
};
}
function switch_domain($domain) {
return "http://$domain".$_SERVER['REQUEST_URI'];
}
function Ymd($time=null) {
if(is_null($time)) $time = time(... | true |
684fdad2b0df3bedd03b6c7081cc318ce8e7cf40 | PHP | ChrGriffin/advent-of-code | /day_2/star_2.php | UTF-8 | 572 | 2.78125 | 3 | [] | no_license | <?php
require_once '../helpers.php';
// load and parse boxes from the txt file
$boxes = loadFile(__DIR__ . '/boxes.txt');
$similarBoxes = [];
foreach($boxes as $box) {
foreach($boxes as $innerBox) {
if(levenshtein($box, $innerBox) === 1) {
$similarBoxes[$box] = null;
$similarBoxes... | true |
6d008d4b5843d72db4c3a6ecdf756db56cae04a3 | PHP | andysarbini/new_hris | /web/cms/modules/navigation/views/child-nav.php | UTF-8 | 2,573 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
if(count($menus)){ ?>
<ul class="nav nav-tabs nav-stacked bgtransitions accordion">
<?php
//echo 'count:'.count($menus);
$before_uri = '';
$before_title = '';
$before_level = 0;
#$c = -1; // version 1
$c=0;
$before_write = '';
$out = '';
#$menus[] = array('uri'=>'', 'level'=>0, 'title'=>'');
... | true |
4e8e792865f557849dec8d5f7a67fa68300901e5 | PHP | Ange-Gardien/iheb_dridi | /createc.php | UTF-8 | 1,794 | 2.6875 | 3 | [] | no_license | <?php
if (isset($_POST['createc'])) {
include "db_conn.php";
function validate($data){
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
$id = validate($_POST['id']);
$password = validate($_POST['password']);
$name = validate($... | true |
01c4771ca56e194e9ebaa82b8933951a40b2bd2c | PHP | hazeem1991/email_service | /app/Http/Libraries/EmailSenders/MailJet/MailjetMailer.php | UTF-8 | 3,084 | 2.65625 | 3 | [] | no_license | <?php
namespace App\Http\Libraries\EmailSenders\MailJet;
use App\Http\Models\Message;
use App\Http\Models\ProviderAccount;
use App\Http\Libraries\EmailSenders\Mailer;
use App\Http\Libraries\EmailSenders\MailerResult;
use Mailjet\Resources;
use Mailjet\Client;
class MailjetMailer implements Mailer
{
private $send... | true |
fb4610586a44c233b2924f1f3f41de55214c4da2 | PHP | Mazinkam/AlisGameStore | /storeadmin/inventory_list.php | UTF-8 | 7,791 | 2.84375 | 3 | [
"MIT"
] | permissive | <?php
session_start();
if (!isset($_SESSION["manager"])) {
header("location: admin_login.php");
exit();
}
// Be sure to check that this manager SESSION value is in fact in the database
$managerID = preg_replace('#[^0-9]#i', '', $_SESSION["id"]); // filter everything but numbers and letters
$manager = preg_rep... | true |
2f3d35a4339ec855a187a9c7419d9ee7af83b000 | PHP | bossanova808/CommerceMailer | /commercemailer/controllers/CommerceMailerController.php | UTF-8 | 11,023 | 2.703125 | 3 | [
"LicenseRef-scancode-other-permissive"
] | permissive | <?php
namespace Craft;
class CommerceMailerController extends BaseController
{
protected $allowAnonymous = array('actionEmailProductEnquiry', 'sendMail');
/**
* Checks that the 'honeypot' field has not been filled out (assuming one has been set).
*
* @param string $fieldName The honeypot fiel... | true |
8ec5a348b9b117e53fe8db1c1151cb5a2d00c895 | PHP | goosman-lei/ice | /src/Filter/CompileException.php | UTF-8 | 692 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace Ice\Filter;
class CompileException extends \Exception {
public function __construct($compiler, $message) {
$lineEnd = strpos($compiler->srcCode, "\n", $compiler->lineStart);
$codeLine = substr($compiler->srcCode, $compiler->lineStart, $compiler->position - $compiler->lineStart)... | true |
ba6b96687ceaa1b074dc8fceb2f2e88b8a1b7d7a | PHP | live-admin/business | /czy_www/colourlife/common/models/TaskDate.php | UTF-8 | 21,310 | 2.609375 | 3 | [] | no_license | <?php
/*
* @version 国庆7天乐model
*/
class TaskDate extends CActiveRecord{
private $startDay='2016-10-01';//活动开始时间
private $endDay='2016-10-07 23:59:59';//活动结束时间
private $zhuFuCount=5;
private $day=7;
private $dateArr=array(
1=>'2016-10-01',
2=>'2016-10-02',
3=>'2016-10-03',
... | true |
10b15eda40c3fd946e4080566b2bc8f117456663 | PHP | Marketo/SilverStripe-ContextAwareUploadField | /code/forms/ContextAwareUploadField.php | UTF-8 | 1,784 | 2.75 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
/**
*
* @package default
*/
class ContextAwareUploadField extends UploadField
{
private static $upload_paths = array();
/**
* Description
* @return string
*/
public function getFolderName()
{
if(isset($this->folderName) && $this->folderName !== false) {
retu... | true |
3696ec9e1ed585aef2a5e783a492e5cee7db254b | PHP | Zigman13/xtubephp7 | /classes/Zend/Gdata/Gapps/Extension/Name.php | UTF-8 | 1,909 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | <?php
require_once 'Zend/Gdata/Extension.php';
require_once 'Zend/Gdata/Gapps.php';
class Zend_Gdata_Gapps_Extension_Name extends Zend_Gdata_Extension
{
protected $_rootNamespace = 'apps';
protected $_rootElement = 'name';
protected $_familyName = null;
protected $_givenName = null;
public f... | true |
248f1f77a2a9c387627677d64e3f08f476e1777e | PHP | adhocore/php-cli | /tests/IO/InteractorTest.php | UTF-8 | 4,081 | 2.859375 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of the PHP-CLI package.
*
* (c) Jitendra Adhikari <jiten.adhikary@gmail.com>
* <https://github.com/adhocore>
*
* Licensed under MIT license.
*/
namespace Ahc\Cli\Test\Helper;
use Ahc\Cli\Input\Reader;
use Ahc\Cli\IO\Interactor;
use Ahc\Cli\Output\Writer;
use Exception;
use PHP... | true |
5a24b884ba979e27117fbda3ada198033afb2a31 | PHP | WizzardCat/Symfony | /symfonyLearning/src/CSJ/BlogBundle/Entity/Category.php | UTF-8 | 2,024 | 2.59375 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | <?php
namespace CSJ\BlogBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Category
*
* @ORM\Table(name="category")
* @ORM\Entity(repositoryClass="CSJ\BlogBundle\Repository\CategoryRepository")
*/
class Category
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
... | true |
c101727ac03ae4bbbb28bdcbd3e67a83566ca6c2 | PHP | ishyevandro/SimpleMazeResolver | /tests/ConverterTest.php | UTF-8 | 1,343 | 2.78125 | 3 | [] | no_license | <?php
use IshyEvandro\Converter;
Class ConverterTest extends PHPUnit_Framework_TestCase
{
protected $Converter;
protected $path = __DIR__.'/files/';
public function setUp()
{
$this->Converter = new Converter();
}
public function testCreateTextFromImageShouldReturnFalseWhenResourceNo... | true |
d80d24f7763ef8adbfa349d773002a6e1f514694 | PHP | YeniferGonzalez/Proyecto-Final-sistema-de-votaciones- | /clases/Periodo.php | UTF-8 | 558 | 3.0625 | 3 | [] | no_license | <?php
class Periodo{
private $idPeriodo;
private $Tipo;
private $Periodo;
public function getidPeriodo(){
return $this->idPeriodo;
}
public function getTipo(){
return $this->Tipo;
}
public function getPeriodo(){
return $this->Periodo;
}
public functio... | true |
461d8c1a9755c9ece0f587bc039513c8550bfe0e | PHP | dakarn/example-project | /system/Helper/File.php | UTF-8 | 520 | 3.1875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: user
* Date: 05.04.2018
* Time: 20:58
*/
namespace Helper;
final class File
{
/**
* @var string
*/
private $file;
/**
* File constructor.
* @param string $file
*/
public function __construct(string $file)
{
$this->file = $file;
}
/**
* @return int
... | true |
30c7b8f0fd804e6d2a40ed6e69bca22f662e9ff4 | PHP | maihuo/maihuowang | /Interface/user/AddressController.php | UTF-8 | 2,022 | 2.671875 | 3 | [] | no_license | <?php
/**
* @name AddressController.class.php
* @description 地址控制器
* @package Home
* @author
*/
namespace Home\Controller;
use Think\Controller;
class AddressController extends Controller {
$address = {
id:"",
userID:"",
phone:"",
contact:"",
... | true |
69d835ebdd27d76fcbf2ba7fcc3a6fa58128c129 | PHP | maxkl/MVC-Skeleton | /index.php | UTF-8 | 1,001 | 2.890625 | 3 | [] | no_license | <?php
/**
* Ein kleines simples php mvc framework
* @author Max Klein <max@kleinleibold.de>
*/
/**
* Diese Konstante wird in eingebundenen Dateien überprüft um direkten Zugriff zu verhindern.
*/
define('_EXEC', 1);
/**
* Für das error handling
*/
define('ENVIRONMENT', "debug");
if(defined('ENVIRONMENT')) {
... | true |
63c6dc388d41560f2002c780e4f1bd67f20b0e87 | PHP | Victorsousalemos/PHP-udemy | /tipo-null.php | UTF-8 | 499 | 3.171875 | 3 | [
"MIT"
] | permissive | <?php
include 'header.php';
include 'functions/functions.php';
$aula_atual = 'tipo-null';
?>
<body>
<h2>NULL</h2>
<hr>
<small>Curso de Básico de PHP - Prof. Ivan Lourenço Gomes</small>
<h3>NULL = Ausência de valor</h3>
<?php $posts = 0;
var_dump($posts);
echo '<br><br>';
if ($posts ... | true |
b822442706fdc8b3107784f2e8560df8e0818a03 | PHP | SalomonD/Projet-GL | /app/Emprunt.php | UTF-8 | 1,468 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
/**
* @property int $matricule
* @property int $idEmprunt
* @property string $dateEmprunt
* @property float $montantEmprunt
* @property float $montantARembourse
* @property int $idFond
* @property Adherent $adherent
* @property Fond $fond
* @prope... | true |
ee2e5fbafa72b95d19127781a46ee055aa5c3848 | PHP | dipsycat/poker | /src/Service/CardCalculate.php | UTF-8 | 15,150 | 3.21875 | 3 | [] | no_license | <?php
namespace App\Service;
use App\Card;
use App\CardPrint;
class CardCalculate
{
const ROYAL_FLUSH = 'Royal Flush';
const STRAIGHT_FLUSH = 'Straight Flush';
const FOUR_OF_A_KIND = 'Four of a Kind';
const FULL_HOUSE = 'Full House';
const FLUSH = 'Flush';
const STRAIGHT = 'Straight';
con... | true |
bccd01ef3851d86fc271e32f2cf2197c0fa8b761 | PHP | marcduren/php-utiles | /rapportexcel.class.php | UTF-8 | 3,548 | 2.8125 | 3 | [] | no_license | <?php
use Vtiful\Kernel\Excel;
use Vtiful\Kernel\Format;
class RapportExcel
{
public $excel = null;
public $colonnes = array(); // [id=>'code',libelle=>'libellé',lg=>10]
public $premiereLigne = 1;
public $ligne = 2;
public function __construct($fichier = 'rapport.xlsx', $classeur='Feuille 1', $gri... | true |
654249d0b21ffa709dbafc8f11e9b4a95c8f508a | PHP | skiliks/skiliks | /protected/components/SocialCalc/ScXlsConverter.php | UTF-8 | 3,904 | 2.84375 | 3 | [] | no_license | <?php
/**
* Class ScXlsConverter
*/
class ScXlsConverter
{
/**
* Тип xls
*/
const TYPE_XLS = 'xls';
/**
* Тип sc
*/
const TYPE_SC = 'sc';
/**
* Серелизация
*/
const TYPE_SERIALIZE = 'serialize';
/**
* Сохраняет файл xls в sc
* @param PHPExcel|str... | true |
8952954009c1ee9005a2edd5e14cabc461116fa0 | PHP | understand/understand-monolog | /src/UnderstandMonolog/Handler/UnderstandSyncHandler.php | UTF-8 | 1,068 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php namespace UnderstandMonolog\Handler;
class UnderstandSyncHandler extends UnderstandBaseHandler
{
/**
* Send data to storage
*
* @param mixed $requestData
* @return type
*/
protected function send($requestData)
{
$endpoint = $this->getEndpoint();
$ch = curl_in... | true |
53442b87e8818f4214212078d7f153a392b1ef94 | PHP | khaingzinthant77/store | /admin/book/book-edit.php | UTF-8 | 1,717 | 2.890625 | 3 | [] | no_license | <?php
include("../confs/config.php");
$id = $_GET['id'];
$result = mysqli_query($con,"SELECT * FROM book WHERE id = $id");
$row = mysqli_fetch_assoc($result);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="style... | true |
71c928049c006add3cff7fdb51e5d1e6b4dbcb27 | PHP | ctec-127/ctec-227-final-project-Xavier-Cornwell | /black-dashboard-html-v1.0.0/site/login.php | UTF-8 | 4,790 | 2.53125 | 3 | [
"MIT",
"JSON"
] | permissive |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha3... | true |
a1eff596e2f77d81e9f6ae1e4b6b65ec758efcc3 | PHP | nWidart/nw-cleanV2 | /functions.php | UTF-8 | 7,623 | 2.5625 | 3 | [] | no_license | <?php
/* ------------------------------------------------------------------------------------------------------------------------
* nwclean functions and definitions
*
* Sets up the theme and provides some helper functions. Some helper functions
* are used in the theme as custom template tags. Others are attached t... | true |
23a6ebbb7bbaba3aab3de75fd354aeea539dd66c | PHP | Cabral221/AfiWEI | /app/Http/Controllers/RoomController.php | UTF-8 | 2,569 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use App\Model\Room;
use Illuminate\Http\Request;
class RoomController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Display... | true |
1e70a68aa1ea35465e0e11bb3264a24cc5fe12ee | PHP | thebiggive/matchbot | /src/Migrations/Version20200713104818.php | UTF-8 | 1,352 | 2.65625 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace MatchBot\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Add fields to support multiple PSPs and Stripe PaymentIntent client secrets
*/
final class Version20200713104818 extends AbstractMigration
{
public function getDescri... | true |
931866334103726ad14c1569f76a899db557c8ce | PHP | Jamdoog/attack-page | /index.php | UTF-8 | 3,912 | 2.828125 | 3 | [] | no_license | <?php
//Import PHPMailer classes into the global namespace
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require_once 'vendor/autoload.php';
function sendMail($type, $name) {
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host = 'smtp.googlemail.com'; //gmail SMTP server
... | true |
45989e7fbc99d9bce645dfa3cef350211bb36de6 | PHP | krlsg/musicCatalogue | /App/Model/PlayerModel.php | UTF-8 | 331 | 2.625 | 3 | [] | no_license | <?php
namespace musicCatalogue\Model;
use musicCatalogue\Repository\CommentsList;
class PlayerModel
{
public function getCommentData($track_id)
{
$comments = new CommentsList();
$commentData = $comments->getListOfComments($track_id);
//var_dump($pageData);
return $commentDat... | true |
e67c1839a08cc2c0c126405487972c95a830b105 | PHP | angel-zepeda/queryOfflinePHP | /connection.php | UTF-8 | 339 | 2.546875 | 3 | [] | no_license | <?php
function getConnection() {
$db = "queryOffline";
$server = "localhost";
$password = "Angel_05";
$user = "root";
$link = mysqli_connect($server, $user, $password) or die ("No se ha podido conectar");
$db = mysqli_select_db($link, $db) or die("No se ha podido conectar a la BD");
return... | true |
8b664a37ef836b6e163b255175854df9d4edf787 | PHP | jvitormichels/gerenciamentoDeProjetos-Sistema | /phpFunctions/Activity_Submit.php | UTF-8 | 1,540 | 2.796875 | 3 | [] | no_license | <?php
session_start();
//criar conexão
$link = mysqli_connect("localhost", "root", "", "euax_desafio");
//pega o id do projeto, armazenado no url, ao qual a atividade pertencerá
$project_id = $_GET['id'];
//resgata informações do formulário html
$activity_name = $_POST['activity_name'... | true |
12f3146e49eb01f2ea0b1f4d1a0c13755632bc60 | PHP | AlanCILee/JavaScriptProject | /updateAndNewPos.php | UTF-8 | 4,309 | 2.6875 | 3 | [] | no_license | <?php
/*http://ec2-52-201-212-193.compute-1.amazonaws.com/phpmyadmin/*/
$servername = "ec2-52-201-212-193.compute-1.amazonaws.com";
$username = "s2016a_user18";
$password = "s2016a_user18";
$dbname = "s2016a_user18";
// ================== img input =======================
if(isset... | true |
52cf26987e2a6591008559bc85456407c9eb50d8 | PHP | przeslijmi/Sirouter | /src/Route.php | UTF-8 | 10,638 | 3.03125 | 3 | [] | no_license | <?php declare(strict_types=1);
namespace Przeslijmi\Sirouter;
use Przeslijmi\Sexceptions\Exceptions\ClassFopException;
use Przeslijmi\Sexceptions\Exceptions\MethodFopException;
use Przeslijmi\Sexceptions\Exceptions\ParamOtosetException;
use Przeslijmi\Sirouter\Tools\AttributeExploder;
/**
* Route element.
*
* Sir... | true |
13690a31b59977b96ac2e2978506602dadd061f1 | PHP | axiles89/amop-profiler | /lib/MessageFactory/MessageFactory.php | UTF-8 | 1,802 | 3 | 3 | [] | no_license | <?php
/**
* MessageFactory.php
*
* @package axiles89\profiler\MessageFactory
* @date: 23.09.2015 20:14
* @author: Kyshnerev Dmitriy <dimkysh@mail.ru>
*/
namespace axiles89\profiler\MessageFactory;
use axiles89\profiler\Logger\BaseLogger;
/**
* Фабрика для генерации простых сообщений
* Class MessageFactory
... | true |
8c6ee79b76ba7971fa20ce00436db48864bdf33d | PHP | ffelixarkusnexus/timetracker-vanilla | /public/bars_test/src/Application.php | UTF-8 | 1,285 | 2.984375 | 3 | [] | no_license | <?php
class Application
{
protected $tz = 'America/Tijuana';
public function run()
{
$users = $this->getUsers();
$users = $this->transform($users);
$this->render($users);
}
protected function getUsers()
{
return [
[
'name' => 'luis',
'tz' => 'America/Tijuana',
],
[
'name' => 'pac... | true |
21dd8d6ee91019167f7c3345b35e3bd6dfee68e9 | PHP | hujinheng/web | /learn/thinkphp/test.php | UTF-8 | 5,249 | 2.96875 | 3 | [] | no_license | <?php
//error_reporting(0);#关闭 PHP 提示的方法 或者修改 php.ini 的 error_reporting = E_ALL & ~E_NOTICE
// $str = "hello";
// $arr = array("string",123,3.14);;
// echo $str . "world";
// echo "<br>";
// var_dump($arr);
// echo "<br>";
// $t = date("H");
// echo $t;
// echo "<br>";
// $a = 1;
// $a += 1;
// echo $a;
//
// for ($i=... | true |
e60760e8bb6bbcb5fcb46e8d25f8a88e434024e1 | PHP | woudX/JbpanWebPart | /Lib/Common/PremAccess.class.php | UTF-8 | 2,091 | 2.59375 | 3 | [] | no_license | <?php
class PremAccess {
static private $PREM_KEY = 'dk_Premission';
static private $ADMIN_PREM_NAME = 'administrator';
//访问某权限
static public function access( $premNames ){
$userKey = C('SESSION_USER_KEY');
$uid = Session::get($userKey);
if(empty($uid))return false;
$premNameArr = ex... | true |
82e01d80e5f4f319ad822ef0a93068e8aa6c4461 | PHP | ASCTech/http_authentication | /http-authentication.php | UTF-8 | 6,374 | 2.625 | 3 | [] | no_license | <?php
/*
Plugin Name: OSU Wordpress MU Shibboleth
Version: 0.2
Description: DO NOT UPDATE THIS PLUGIN THROUGH THE ADMIN INTERFACE. Authenticates users with Shibboleth. Only users that have an existing wordpress account are authenticated. Based on HTTP Authentication by Daniel Westermann-Clark found at https://dev.webad... | true |
5244e9b284a38332bc1be520d9f27deba4cc51fc | PHP | vladyslav-p01/hw-yii | /frontend/components/ObjToArrayComponent.php | UTF-8 | 395 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: user
* Date: 15.11.15
* Time: 17:21
*/
namespace frontend\components;
use yii\base\Component;
class ObjToArrayComponent extends Component {
private $array = [];
public function convertToArr($obj)
{
foreach ($obj as $key => $field) {
$th... | true |
5aaa544b5e2df104e4902d8b64638c4db535a3d7 | PHP | krajewskis/php-task-manager | /src/php/TaskManager/Environment.php | UTF-8 | 1,058 | 2.734375 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: krajewski
* Date: 25.8.14
* Time: 14:24
*/
namespace TaskManager;
/**
* Class Environment
* @package TaskManager
*/
/**
* Class Environment
* @package TaskManager
*/
class Environment
{
/**
* @var string
*/
private static $appDir;
/**
* @var string
*/
p... | true |
4da86e6536ce2310c8685a2fbabeba1fb38010f1 | PHP | bovigo/vfsStream | /tests/phpunit/vfsStreamUmaskTestCase.php | UTF-8 | 4,710 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
declare(strict_types=1);
/**
* This file is part of vfsStream.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace bovigo\vfs\tests;
use bovigo\vfs\vfsStream;
use PHPUnit\Framework\TestCase;
use function bovigo\asser... | true |
d39b882df6128a6080fa0f11dfd034b1ba998f31 | PHP | idiey/Esolat-Malaysia | /tests/LocationProviderTest.php | UTF-8 | 4,581 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace Tests;
require_once __DIR__ . '/../vendor/autoload.php';
use Afiqiqmal\SolatJakim\Library\Period;
use Carbon\Carbon;
use PHPUnit\Framework\TestCase;
/**
* RequestTest.php
* to test function in Request class
*/
class LocationProviderTest extends TestCase
{
public function testGetWaktuByDaySuccess()... | true |
7e3be3b6307b2e1f3b8ee8124300c456a2aecb6e | PHP | eduardosasso/showtimes | /adapters/GncAdapter.php | UTF-8 | 2,839 | 2.515625 | 3 | [] | no_license | <?php
include realpath($_SERVER["DOCUMENT_ROOT"]) . '/classes.php';
abstract class GncAdapter extends AbstractCinemaAdapter {
public function scrape() {
$url = 'http://www.gnccinemas.com.br/conteudo/home.asp';
$referer = 'http://www.gnccinemas.com.br/conteudo/home.asp';
$curl_handle=curl_init();
/*
TOD... | true |
d07da96da9f8caec087f11db49cdf8520db9fbc8 | PHP | arkzzgod/learn-php | /lessons/lesson23/index.php | UTF-8 | 758 | 3.71875 | 4 | [] | no_license | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content='width=device-width, initial-scale=1.0'>
<title>Урок 23</title>
</head>
<body>
<?php
$number = 90;
switch(true) {
case ($number > 0 && $number <= 10):
echo "$number меньше 10 и больше... | true |
6e9f6247d85fbf45e738369baffc504079dda472 | PHP | skrisztian/ted-translator-tracking | /otp/scripts/api_test.php | UTF-8 | 5,062 | 2.796875 | 3 | [] | no_license | <?php
// This is a test script to verify if
// the Amara API is working as expected
// Find out file location
if (preg_match('/\/archifa\//', __FILE__)) {
// We are on the production server
// Set ini file to:
$otp_ini = parse_ini_file('/home/archifa/otp/conf/otp.ini', true);
} else {
// We are somewhere else an... | true |
455a4f1fc5cdeca32052b06a9390ede78fca6d97 | PHP | sorceresslulu/php-yell-test-task | /src/task-01/FigureTask/Figure/Figures/Circle/CircleAttributes.php | UTF-8 | 575 | 3.203125 | 3 | [] | no_license | <?php
namespace FigureTask\Figure\Figures\Circle;
class CircleAttributes
{
/**
* Radius
* @var int
*/
private $radius;
/**
* CircleAttributes constructor.
* @param int $radius
*/
public function __construct($radius) {
$this->radius = $radius;
}
/**
*... | true |
31d87e7b6e6bc3d42237c8204dce6be5408574c3 | PHP | danielscheidler/cybihomecontrol_ui | /functions/messages_functios.php | UTF-8 | 1,442 | 2.515625 | 3 | [] | no_license | <?php
function checkForMessages(){
if (isMessageForCurrentUser()){
showMessageInfo();
}
}
function isMessageForCurrentUser(){
if(isset($_SESSION['MENU_PARENT']) && $_SESSION['MENU_PARENT']!="Mein Profil"){
if($_SESSION['config']->CURRENTUSER->STATUS == "admin" || $_SESSION['config']->CURR... | true |
7a01f6070094c25d9e2443d606e64e6fdeee1e0d | PHP | astrid42000/cvPoo | /models/manager/formationManager.php | UTF-8 | 2,149 | 2.828125 | 3 | [] | no_license | <?php
class formationManager extends dbManagerCv
{
/**
* formationManager constructor.
*/
public function __construct()
{
parent::__construct();
}
public function allFormations(){
$formations=[];
$requete='SELECT * FROM formation ORDER BY id_formation DESC';
... | true |
6c48d75023336a671d0488385eabb985ceb9f2c4 | PHP | mjscode/mylsRetail | /utils/getUrl.php | UTF-8 | 703 | 2.84375 | 3 | [] | no_license | <?php
//checks if root is myslRetail, if so returns url minus mylsRetail.
function getRootUrl($urlString){
if( strstr($urlString,'mylsRetail') ){
$inner = strstr($urlString,'mylsRetail');
$newString = strstr($inner,'/');
} else{
$newString = $urlString;
... | true |
997148373460b63207e11b77280f028837038aa2 | PHP | generalsoftby/code-examples | /Oleg/PHP-Services/Models/CalculationVariables/CalculationVariableEntity.php | UTF-8 | 812 | 2.78125 | 3 | [] | no_license | <?php
namespace App\Model\Calculator\CalculationVariables;
use App\Services\Calculators\Errors;
use Dios\System\Multicasting\Interfaces\SimpleArrayEntity;
/**
* The base interface for entities of calculation variables.
*/
interface CalculationVariableEntity extends SimpleArrayEntity
{
/**
* Returns true w... | true |
6ba5a66566b8331bcc2dde3484536004955f5ceb | PHP | DesarrolloLaravel/etiquetado | /database/seeds/EspecieTableSeeder.php | UTF-8 | 581 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Seeder;
use Faker\Factory as Faker;
use App\Models\Especie;
class EspecieTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
//
$faker = Faker::create();
$especies = [];
fo... | true |
b2b037b9540c132592b6ec99b2e4a55b0dc097c9 | PHP | gubitna/luxon | /src/Luxon/Bundle/CmsBundle/Entity/NodeAttributeValue.php | UTF-8 | 1,660 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace Luxon\Bundle\CmsBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* NodeAttributeValue
*/
class NodeAttributeValue
{
/**
* @var string
*/
private $value;
/**
* @var \Luxon\Bundle\CmsBundle\Entity\Node
*/
private $node;
/**
* @var \Luxon\Bundle\CmsBun... | true |
61462a690bbc4f0c90cff6c350b4c8f59acffa80 | PHP | cliffordvickrey/the-gambler | /src/Domain/HandTypeResolver/Strategy/FullHouseStrategy.php | UTF-8 | 929 | 2.828125 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace Cliffordvickrey\TheGambler\Domain\HandTypeResolver\Strategy;
use Cliffordvickrey\TheGambler\Domain\Collection\HandTypeCollection;
use Cliffordvickrey\TheGambler\Domain\Enum\HandType;
use Cliffordvickrey\TheGambler\Domain\Utility\HandDecorator;
use function array_values;
use f... | true |
589c78222a69cc2f4b17a8ec6d0eef1c19541156 | PHP | miguelrb22/laraveles | /app/Http/Controllers/email/EmailController.php | UTF-8 | 1,623 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: Miguel
* Date: 21/04/2015
* Time: 10:12
*/
namespace app\Http\Controllers\email;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
/**
* Class EmailController
* @package app\Http\Controllers\email
*/
class EmailController extends Controller {
/*... | true |
2a477214595f1d9389a893eaf0700cc65c26e5da | PHP | mcbraga72/instacambio | /src/br/com/InstaCambio/Scraper/Strategy/ScraperStrategyBuilder.php | UTF-8 | 3,134 | 2.609375 | 3 | [] | no_license | <?php
namespace br\com\InstaCambio\Scraper\Strategy;
use br\com\InstaCambio\Model\ExchangeOffice;
class ScraperStrategyBuilder
{
/**
* @var ScraperStrategy[]
*/
private static $scraperStrategies = [];
/**
* @param ExchangeOffice $exchangeOffice
* @return ScraperStrategy
*/
... | true |
2f895c1ddb7cb32dfaa4b9a341a0b9fcfa316041 | PHP | saroven/YouTube-Clone | /signin.php | UTF-8 | 2,552 | 2.515625 | 3 | [] | no_license | <?php
require 'include/config.php';
require 'include/classes/Constants.php';
require 'include/classes/FormValidation.php';
require 'include/classes/Account.php';
$account = new Account($conn);
$validate = new FormValidation();
if (isset($_POST['submit'])){
$username = FormValidation::sanitizeFormUsername($_POST['u... | true |