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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
6cbcec8281be59c863fbcd7ef330501f6589b909 | PHP | Babsbyfaye/jira-integration | /src/Comment.php | UTF-8 | 4,287 | 3.015625 | 3 | [
"MIT"
] | permissive | <?php
namespace Inachis\Component\JiraIntegration;
use Inachis\Component\JiraIntegration\JiraConnection;
/**
* Object for interacting with comment part of the
* Issue resources from the Jira API
*/
class Comment extends JiraConnection
{
/**
* @var Authentication Reference to instance of self
*/
... | true |
e743a402ebfef4ffd907667303f82cf0fc42604b | PHP | andparsons/mage-app-start | /app/code/Magento/Customer/Model/Data/ValidationRule.php | UTF-8 | 894 | 2.578125 | 3 | [] | no_license | <?php
namespace Magento\Customer\Model\Data;
use Magento\Customer\Api\Data\ValidationRuleInterface;
class ValidationRule extends \Magento\Framework\Api\AbstractSimpleObject implements
\Magento\Customer\Api\Data\ValidationRuleInterface
{
/**
* {@inheritdoc}
*/
public function getName()
{
... | true |
7bbe9639911d95e36fccd1bbb55f292a523b5c5e | PHP | carloswph/valium-pt | /src/Nif.php | UTF-8 | 4,338 | 3.046875 | 3 | [] | no_license | <?php
namespace Valium\PT;
/**
* Validates an array of NIF numbers for the Portuguese market.
*
* @since 1.0.0
* @author WP Helpers | Carlos Matos
*/
class Nif
{
protected $allowedInit = [1, 2, 3, 5, 6, 8, 9];
public function check(array $codes, bool $getType = false, string $type = 'nif')
{
$results =... | true |
93dd627f5d97d0b5771ef96ba7ad89c61fdd126e | PHP | dotbm/retailCRM-tests | /app/Models/User.php | UTF-8 | 1,113 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
//use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Auth\Authenticatable;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Database\Eloquent\Model;
use Kodeine\Acl\Traits\HasRole;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
u... | true |
62809d9371086e00f2f092ec1013e8b8ca5b6896 | PHP | jose-pleonasm/Giddy | /LiveUser.php | UTF-8 | 6,136 | 2.671875 | 3 | [] | no_license | <?php
/**
* LiveUser
*
* @link https://github.com/jose-pleonasm/Giddy
* @category Giddy
* @package Giddy
* @version $Id: LiveUser.php, 2011-03-10 14:49 $
*/
Base::import('Common');
Base::import('Storage/Client');
/**
* Reprezentuje aktualniho uzivatele
*
* Umoznuje udruzeni stavu mezi jednotl... | true |
686998668985881d993727510c74b32bc28fd128 | PHP | AdrianRomeroRamirez/Tarea_6_servidor | /eliminarProducto.php | UTF-8 | 608 | 2.8125 | 3 | [] | no_license | <?php
// Archivo para eliminar un producto
include('claseDB.php');
$cod = $_POST['cod'];
// Si recibe datos del codigo, borra el producto
if (!empty($cod)) {
try {
$con = claseDB::conexionBD();
$query = "DELETE FROM producto WHERE cod = ?";
$result = $con->prepare($query);
$resul... | true |
535a5737cad65d17ef1a6e3c3ad184713de141e8 | PHP | kr9ly/cmstoolkit | /core/auth/MongoAuth.php | UTF-8 | 2,169 | 2.671875 | 3 | [] | no_license | <?php
namespace core\auth;
use core\exceptions\LoginIncorrectException;
use core\User;
use core\Session;
use core\exceptions\UserAlreadyExistsException;
use core\Mongo;
class MongoAuth extends Instance {
private $collection;
public function init() {
$client = Mongo::getClient($this->getOption('conn', 'defau... | true |
cd1470aca952ec82d4de84abedcae4de06e20fbe | PHP | olbibigo/Ilmatar | /src/Entities/Document.php | UTF-8 | 4,688 | 2.59375 | 3 | [] | no_license | <?php
namespace Entities;
use Doctrine\ORM\Mapping as ORM;
use Ilmatar\BaseEntity;
/**
* Document
*/
class Document extends BaseEntity
{
/**
* @var integer
*/
private $id;
/**
* @var string
*/
private $name;
/**
* @var string
*/
private $mime;
/**
*... | true |
ba59034fc3788f9eca5d5f69fcf690115867319c | PHP | elvislakota/WhatsApp-API | /src/Controllers/ID_Encoder.php | UTF-8 | 552 | 2.6875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | <?php
namespace WhatsAppAPI\Controllers;
class ID_Encoder extends PBKDF2_Controller {
public function getSecretKey($password, $salt) {
$iterationCount = 16;
$keyLength = 128;
$saltS = '';
foreach ($salt as $item) {
$saltS .= $item;
}
return $this->PBEKeySpec($password, $saltS, $iteration... | true |
6729f8ef4fac068820e1684af53fc935dcad7a77 | PHP | kaan3434/gvindelen | /Swim4/php/soap/olymp_xml.php | UTF-8 | 9,347 | 2.59375 | 3 | [] | no_license | <?php
require_once "libs/Download.php";
require_once "libs/GvStrings.php";
require_once "libs/GvHtmlSrv.php";
require_once "libs/utf2win.php";
require_once "booker_xml.php";
class booker extends booker_xml {
private $header;
function __construct() {
$this->booker = 'olymp';
... | true |
046dfbb9ffb9d31cc42eb4dff0fd8d1a5fa78e46 | PHP | FatBeaver/AmoCRM-TestWork | /ApiWorker.php | UTF-8 | 3,218 | 2.8125 | 3 | [] | no_license | <?php
class ApiWorker
{
/**
* Базовый путь API
*/
const BASE_URL = 'https://dbistest.amocrm.ru';
/**
* Часть пути необходимая для авторизации.
*/
const AUTH_PART_URL = 'USER_LOGIN=dbistest@test.com&USER_HASH=9e3ce3e9a8fe6ff15dcfcae67aa4c48a7c94c880';
/**
* Функция воз... | true |
585e32267326d13ba76c260eac6903d153f7860c | PHP | octavianparalescu/daily-tasks | /src/Main/Action/IndexAction.php | UTF-8 | 746 | 2.5625 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace DailyTasks\Main\Action;
use DailyTasks\Framework\ADR\Action\HTTPAction;
use DailyTasks\Framework\ADR\Contract\ActionHandlerInterface;
use DailyTasks\Framework\ADR\Contract\ActionInterface;
use Symfony\Component\HttpFoundation\ParameterBag;
use Symfony\Component\HttpFoundation... | true |
d51c86baeca1f32b0307672ba02c560655d53263 | PHP | chipslays/array | /src/Arr.php | UTF-8 | 3,152 | 3.140625 | 3 | [
"MIT"
] | permissive | <?php
namespace Chipslays\Arr;
class Arr
{
const NOT_FOUND = 'NOT__FOUND__4MfvLvGl:htK$ZAiRoEylHo7?CgIrCDDQWrT2qUBSazEd?mpwFPq@pWRFbtjqhHJ=R8Y!w4hujyWWNwEnsZ1VmQ?';
/**
* Get value from array using by dot notation key.
*
* @param array $array
* @param string|array $keys
* @param mixe... | true |
8743b4f079f3dd10f448335d0ce56f8dca0ba52b | PHP | TyRun555/otus | /Test/core/TestCase.php | UTF-8 | 888 | 3 | 3 | [] | no_license | <?php
namespace test;
use Exception;
class TestCase
{
public $inputPath;
public $caseName;
public $input;
public $expectedResult;
public function __construct($casePath)
{
if (empty($casePath) || !file_exists($casePath)) throw new Exception('Не указан тестовый случай!');
$this... | true |
f0f27dd95ac86927aaf032d99af07db777e51ce9 | PHP | tomwalder/php-map-reduce | /src/Mapr/Async/NamedQueueInterface.php | UTF-8 | 541 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace Mapr\Async;
interface NamedQueueInterface
{
/**
* Name of the queue
*
* @param $name
*/
public function __construct($name);
/**
* Add a single task to the queue
*
* @param HttpCallbackInterface $callback
* @return mixed
*/
public function ... | true |
82c99dacfcd64773a6986e40a863c8e3773ab7b4 | PHP | tellyworth/tw-escapist | /tw-db.php | UTF-8 | 2,412 | 3.25 | 3 | [] | no_license | <?php
class TW_DB extends wpdb {
public $escaped = array();
public function __construct( $dbuser, $dbpassword, $dbname, $dbhost ) {
// WP_Query uses sanitize_key() to escape some values like post types.
// We need to filter that function in order to count those values as escaped.
add_filter( 'sanitize_key... | true |
5139ac52d537b311e36bc0d8406202a6f2d02488 | PHP | angulonavas/apitwitter | /src/AppBundle/Controller/DefaultController.php | UTF-8 | 13,059 | 2.75 | 3 | [] | no_license | <?php
namespace AppBundle\Controller;
use Abraham\TwitterOAuth\TwitterOAuth;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Config\Definition\Exception\Exception;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Rou... | true |
97998c88ed861014243a66eb72ab8126ad8a2099 | PHP | mishikaluosi/present | /App/Api/Controller/LoginedCommonController.class.php | UTF-8 | 1,164 | 2.5625 | 3 | [] | no_license | <?php
namespace Api\Controller;
use Think\Controller;
//需要登录后请求的方法都继承这个类LoginedCommonController
class LoginedCommonController extends Controller {
protected $userId;
protected $userInfo;
protected function _initialize()
{
// if (!IS_AJAX || !IS_POST) {
// $ret = array('code'=>404,'data'=... | true |
1125511f0858e747e9eccb8af95d5b3f70651b5d | PHP | rozumek/BrokerPanel | /library/Core/View/Helper/FormatId.php | UTF-8 | 338 | 2.546875 | 3 | [] | no_license | <?php
class Core_View_Helper_FormatId extends Core_View_Helper_Abstract
{
/**
*
* @var string
*/
protected $_format = '%05d';
/**
*
* @param string $value
* @return string
*/
public function formatId($value)
{
return sprintf($this->_format, $value)... | true |
090a992a2f1a188f6cca7fe17d9c038a3ecf994b | PHP | Tamma1234/cms | /app/Masks/Comments/CommentMask.php | UTF-8 | 1,947 | 2.578125 | 3 | [] | no_license | <?php
namespace App\Masks\Comments;
use App\Masks\Pages\PageMask;
use App\Masks\Posts\PostMask;
use App\Masks\Posts\SearchMask;
use App\Masks\Products\ProductMask;
use App\Masks\Projects\ProjectMask;
use App\Models\Comment;
use Crazy\Magic\Mask;
class CommentMask extends Mask
{
// xem thêm ExampleMask
/**
... | true |
9dfbcd988b7127cf9e43a97b173a5f56b7d3ceca | PHP | burakgguler/kargakarga | /src/Entity/UserUniversity.php | UTF-8 | 1,478 | 2.625 | 3 | [] | no_license | <?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* UserUniversity
*
* @ORM\Table(name="user_university")
* @ORM\Entity
*/
class UserUniversity
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTI... | true |
acdc3254d551c0bd407366a0ea7c7dd3ddadf77c | PHP | contributte/console-extra | /src/Cache/Cleaners/OpcodeCleaner.php | UTF-8 | 961 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php declare(strict_types = 1);
namespace Contributte\Console\Extra\Cache\Cleaners;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class OpcodeCleaner implements ICleaner
{
public function getDescription(): string
{
return 'OPCode cache';
}
public f... | true |
9b602ecb32c2bf4e1c6c1f6cc69fd16cbce1762a | PHP | xp-framework/xp-framework | /core/src/main/php/math/BigFloat.class.php | UTF-8 | 3,283 | 3.125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/* This class is part of the XP framework
*
* $Id$
*/
uses('math.BigNum');
/**
* A big float
*
* @see xp://math.BigNum
* @test xp://net.xp_framework.unittest.math.BigFloatTest
* @test xp://net.xp_framework.unittest.math.BigIntAndFloatTest
*/
class BigFloat extends BigNum {
... | true |
293e9083e2ca56527955da5dd685dc67796b1024 | PHP | chency147/TextUnitConverter | /converter.php | UTF-8 | 3,017 | 3.3125 | 3 | [] | no_license | <?php
/* ==============================================================
* 单位变化,单位数值转换脚本
* Author: Rick Chen
* Date: 2016-7-19
* Manual: php.exe 这个脚本文件名称 欲转换文件名 比率 原单位 新单位
* 关于比率: 如果a原单位 = b新单位,那么比率=b/a;
* ==============================================================
*
/*
* 修正字符串末尾数值参数
*/
function fixParam($s... | true |
91c83e275a3b227753042aca17f1e8c0ac5eab6e | PHP | kvr000/dryuf-old-php | /_root/trans-core/php/direct/net/dryuf/textual/LongitudeTextual.php | UTF-8 | 2,220 | 2.6875 | 3 | [] | no_license | <?php
namespace net\dryuf\textual;
class LongitudeTextual extends \net\dryuf\textual\LongitudeBaseTextual
{
/**
*/
function __construct()
{
parent::__construct();
}
/**
@\net\dryuf\core\Type(type = 'java\lang\String')
*/
public function check($text, $style)
{
if (!is_null(($groups = \net\dryuf\cor... | true |
329d845036e67f25794dead53c794bdf1fc7ae37 | PHP | mamy1326/sns_mobile_front | /_lib/MasterDB.php | UTF-8 | 11,939 | 2.640625 | 3 | [] | no_license | <?php
/* ================================================================================
* ファイル名 :MasterDB.php
* タイトル :マスタ情報操作用クラス
* 作成者 :間宮 直樹
* 作成日 :2008/08/16
* 内容 :各種マスタ情報の取得・更新処理を実施する。
* 更新履歴*******************************************************************
* 【変更日】 【変更者】... | true |
78aac0f1133a41e54f9afe71ee19b917e0db196d | PHP | a4501150/CourseWork | /CS425/Project/webRoot/movieDetail.php | UTF-8 | 1,814 | 2.640625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | <?php
require_once('header.php');
function __autoload($class_name) {
$path = str_replace('_', '/', $class_name);
require_once $path . '.class.php';
}
session_start();
$movieID = $_REQUEST['mID'];
$_SESSION['mID'] = $movieID;
$rinput = array_key_exists('rinput', $_POST) ? $_POST['rinput'] : null;
if($rinput!=... | true |
ae8e33f8ef6de8411992df2ff095a17dc8e2e93f | PHP | stephenjose/phpclass_github | /PHPFinalExam/index.php | UTF-8 | 1,811 | 2.5625 | 3 | [] | no_license | <?php
/*active record import for database connection*/
require '../ActiveRecord/ActiveRecord.php';
ActiveRecord\Config::initialize(function($cfg)
{
$cfg->set_model_directory('model');
$cfg->set_connections(
array(
'development' => 'mysql://root:@localhost/jobsearch',
'test' => 'mysql://usernam... | true |
a32f9b61e407976e113abaec8decdaf60cca564e | PHP | jrgonzalezrios/od-refactoring | /src/app.php | UTF-8 | 1,440 | 2.671875 | 3 | [] | no_license | <?php
use OrderDesk\App\Integration\ShopifyClient;
use OrderDesk\App\Integration\WooCommerceClient;
$shopifyAPI = new ShopifyClient('https://606d0dd2603ded0017502ede.mockapi.io');
$orders = $shopifyAPI->get_number_of_orders();
$shipments = $shopifyAPI->getShipments(1);
$wooCoomerceAPI = new WooCommerceClient('https... | true |
1ce373aab4ef2da5bd1f5d900e47f11b684ed38f | PHP | yossef-elgendy/Movie-List-Back-End-Project | /ajax/addMovie.php | UTF-8 | 2,468 | 2.703125 | 3 | [] | no_license | <?php
require_once ('../dbConfig.php');
if(isset($_FILES['file'])&& isset($_POST['name']) && isset($_POST['rate']) && isset($_POST['uid']) ) {
$NE = '';
$RE = '';
$IE = '';
$name = filter_var(trim($_POST['name']), FILTER_SANITIZE_STRING);
$rate = floatval(trim($_POST['rate']));
$uID = filter_... | true |
03d075f0580b813e75340224be4e71c05e3728b2 | PHP | Muntarin/Login-in-php | /Crud/dashboard.php | UTF-8 | 1,049 | 2.53125 | 3 | [] | no_license | <?php
require_once './Customer.php';
use App\classes\Customer;
require_once './Login.php';
use App\classes\Login;
$message='';
if(isset($_POST['btn'])){
$customer= new Customer();
$message= $customer->saveCustomerInfo();
}
if(isset($_GET['logout'])) {
$login = new Login();
$login->logo... | true |
924417fb5d3eeb7ed27da9b00ae060f49beb016d | PHP | gangaoh/lop-opensdk-php | /src/Support/GenericResponse.php | UTF-8 | 1,726 | 2.515625 | 3 | [] | no_license | <?php
namespace Lop\LopOpensdkPhp\Support;
use Lop\LopOpensdkPhp\Response;
class GenericResponse implements Response
{
/**
* @var bool
*/
private $succeed;
/**
* @var string
*/
private $traceId;
/**
* @var string
*/
private $zhDesc;
/**
* @var string... | true |
5ce6e62cab11ea6bd09234ca9a73afa584aded1a | PHP | ethanewebtechnologies/travel_vin | /application/models/__admin_catalog/Tour_location_mdl.php | UTF-8 | 1,512 | 2.53125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
* APPLICATION : Spot Model
* AUTHOR : VINAY KUMAR SHARMA
* VERSION : 1.0
* COPYRIGHT : Ethane Webtechnologies Pvt. Ltd.
*/
class Spot_location_mdl extends CI_Model {
public function __construct() {
parent::__construc... | true |
6c238421c960534a9ebdc0761dc008ac9bb6ca1e | PHP | mariosimic79/phpAkademija | /mvc/app/views/home/form.php | UTF-8 | 3,617 | 2.546875 | 3 | [] | no_license | <style>
textarea { display: block; }
</style>
<main>
<h1>Prijavnica za PHP akademiju</h1>
<p>Prijavnica za prvo osječko izdanje PHP akademije koju Inchoo pokreće u suradnji s FERITom.</p>
<p>Prijave traju do 10.10., pa požuri i svoje mjesto rezerviraj već sad.</p>
<p>Više informacija n... | true |
099d49e9a471817380fdb605e662771fba4b96bb | PHP | tswiackiewicz/events-collector | /src/Uuid.php | UTF-8 | 610 | 2.875 | 3 | [
"MIT"
] | permissive | <?php
namespace TSwiackiewicz\EventsCollector;
use Ramsey\Uuid\Uuid as RamseyUuid;
/**
* Class Uuid
* @package TSwiackiewicz\Events
*/
class Uuid
{
/**
* @var string
*/
private $uuid;
/**
* @param string $uuid
*/
public function __construct($uuid)
{
$this->uuid = $u... | true |
d62776b22829f408a7e6d2516bb2e00f2673b4c5 | PHP | Aldante24/ReporTec | /entidades/usuarios.php | UTF-8 | 452 | 2.546875 | 3 | [] | no_license | <?php
class usuarios{
public $id;
function get_id(){
return $this->id;
}
function set_id($id){
$this->id = $id;
}
public $usuario;
function get_usuario(){
return $this->usuario;
}
function set_usuario($usuario){
$this->usuario = $usuario;
}
public $contrasena;
function get_contr... | true |
b3224336731e2429320c81debe9bb7fa7b3e9dcb | PHP | ImperdibleSoft/monopolyOnline | /funciones/funciones.php | UTF-8 | 12,921 | 3.203125 | 3 | [] | no_license | <?php
function ver_array($array){
echo "<pre>";
print_r($array);
echo "</pre>";
}
/* Le da un formato de hora a un dato de tipo fecha. */
function formatear_hora($parametro){
/* Declaro variables personalizadas para que queden claros los datos */
$hora = substr($parametro, 11, 2);
$minuto = substr($pa... | true |
480f25288fd8aa127236e6576941fbcca09aedb8 | PHP | diegogutier/SerapFinallity | /app/Http/Controllers/PeliculasController.php | UTF-8 | 3,124 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use App\Pelicula;
use Illuminate\Http\Request;
use App\Http\Requests;
use Illuminate\Support\Facades\Session;
//tenemos ue llamar al request que se creo
use App\Http\Requests\CreatePeliculasRequest;
class PeliculasController extends Controller
{
public function __construct... | true |
446a0a3649d75f00bd331f973b5e3df97ba2aced | PHP | duylive/PHP | /Relationship_database/connect_database/class/CarDB.php | UTF-8 | 2,110 | 3.25 | 3 | [] | no_license | <?php
class CarDB
{
protected $conn;
public function __construct()
{
$db = new DBConnect();
$this->conn = $db->connect();
}
// lay tat ca du lieu tu db
public function getAll()
{
// chuan bi cau lenh truy
var_dump($this->conn);
die();
$sql ... | true |
f89a74fe5497dfb0e7cfa7c04609e952b20acae7 | PHP | Nicky31/DonkeyCMS | /system/core/Loader.php | UTF-8 | 4,168 | 2.5625 | 3 | [] | no_license | <?php
/*
* Légère abstraction à l'utilisation de l'autoloader \Doctrine2\ClassLoader.php
*/
class Loader extends Singleton
{
/*
* Classes existantes au sein du projet (& ses sous dossiers)
* array[className] = 'filePath';
* Defini par system/libraries/ClassIndexer.php dans l'index
*/
pri... | true |
18d4d97f43a3564ae4e1fcbf7e4bb968ee3e60d0 | PHP | wu30944/JSLove | /database/migrations/2017_11_09_101232_create_admins_table.php | UTF-8 | 1,132 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAdminsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('admins', functio... | true |
362177fd823fcdf62578e5fb6b90199c423525c9 | PHP | zankoav/mb-pravo | /utils/Lang.php | UTF-8 | 747 | 3 | 3 | [] | no_license | <?php
class Lang {
const COOKIE_KEY = 'lang';
const LANGUAGES = [ 'ru', 'en' ];
const BASE_LANG = 'ru';
const CONSTANTS = [
'404_title' => [
'ru' => 'Ошибка 404',
'en' => 'Error 404'
],
'404_description' => [
'ru' => 'Страница не найдена',
'en' => 'Page not found'
]
];
... | true |
29ef426fb4a6c3cad369e0104369bc6db86f36ef | PHP | svovochka/test_symfony | /src/AppBundle/Utils/Paginator.php | UTF-8 | 3,932 | 2.90625 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | <?php
namespace AppBundle\Utils;
use Doctrine\ORM\QueryBuilder;
class Paginator
{
/**
* @var QueryBuilder
*/
protected $queryBuilder;
/**
* @var integer
*/
protected $defaultPerPage = 20;
/**
* @var integer
*/
protected $maxPerPage = 100;
/**
* @var ... | true |
f667f5dbe3a251ee1ce637de560178f52fccbdca | PHP | daniel-dona/hackaton | /01/01.php | UTF-8 | 259 | 2.9375 | 3 | [] | no_license | <?php
$in = str_replace("\n", "", file_get_contents("01.in"));
$out = "";
$a = explode(".", $in);
for($i = count($a); $i > 0; $i--){
$out .= implode(".", array_slice($a, 0, $i))."\n";
}
//echo $out;
file_put_contents("01.out", $out);
?>
| true |
5d895f4a2283cdad43386072651816dfdf28e2eb | PHP | xabela/spa-crud-book-api | /api/objects/category.php | UTF-8 | 3,975 | 3.375 | 3 | [] | no_license | <?php
class Category {
//konekin ke db dan nama tabel
private $conn;
private $table_name = 'categories';
//objek properties
public $id;
public $name;
public $description;
public $created;
//konstruktor dengan $db sebagai db connection
public function __construct($db) {
... | true |
a19c1f4aaa6f4cbe76c0868bf9ccc95c602eed81 | PHP | mo222ez/1dv42e | /Mark II/application/migrations/2013_05_02_162930_create_media.php | UTF-8 | 823 | 2.84375 | 3 | [
"MIT",
"LicenseRef-scancode-dco-1.1"
] | permissive | <?php
class Create_Media {
/**
* Make changes to the database.
*
* @return void
*/
public function up()
{
Schema::create('media', function($table){
$table->increments('id');
$table->string('name');
$table->integer('product_id')->unsigned();
$table->integer('mediatype_id')->unsigned();
$tab... | true |
3a8812d974a16b9edce3862bba1fd6e1445ab7e7 | PHP | bfg-s/admin | /src/Traits/FieldMassControlTrait.php | UTF-8 | 2,423 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace Admin\Traits;
use Admin\Components\FieldComponent;
use Admin\Components\FormGroupComponent;
trait FieldMassControlTrait
{
/**
* @var bool
*/
protected $vertical = false;
/**
* @var bool
*/
protected $reversed = false;
/**
* @var bool
*/
protecte... | true |
28dcd051d91c12cd56a5d9d42e0c4eceaac85df9 | PHP | justgage/ButterflyOils | /admin/index.php | UTF-8 | 3,365 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | <?php
require_once($_SERVER['DOCUMENT_ROOT'] . '/butterfly/admin/include/redirect.php');
include_once($_SERVER['DOCUMENT_ROOT'] . '/butterfly/admin/include/header.php');
?>
<h1>Oils Management</h1>
<div id="oil-list">
<h2>Pages</h2>
<form id="oils-form" action="#" method="post" accept-charset="utf-8">
<input typ... | true |
4580ecb09dc781a26012c3f51571f357e24cf061 | PHP | klim-sherstyankov/restAutorizationSymfony | /src/Entity/Data.php | UTF-8 | 4,557 | 2.625 | 3 | [] | no_license | <?php
namespace App\Entity;
use App\Repository\DataRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=DataRepository::class)
*/
class Data
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="st... | true |
fedeac552eff8aa33610478669d8042c5f684bb1 | PHP | Danack/Blog | /test/Article/InterfaceSegregation/Step1/SearchController.php | UTF-8 | 681 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace Article\InterfaceSegregation\Step1;
use Psr\Http\Message\ServerRequestInterface as Request;
//Example SearchController_before
class SearchController
{
function search(Request $request, DataSource $dataSource)
{
$queryParams = $request->getQueryParams();
if (!array_key_exists(... | true |
0bdba478098cb1324c634a443e05c84e745283ff | PHP | fossabot/CubeBombV2 | /include/functions.php | UTF-8 | 5,366 | 2.78125 | 3 | [
"CC-BY-4.0"
] | permissive | <?php
// Useful functions for CubeBomb development
require_once("/var/www/secure/db.php");
// Get permissions number for specified user id
function getUserPermissions($userId) {
return getSingleValue("SELECT `permissions` FROM `private_users` WHERE `id` =" . escape(intval($userId)) . " LIMIT 0, 1"... | true |
a4e4d984e8ceeea0249b8984b3aa4534a1e02b3b | PHP | clalejandro/LIS-262-Files | /ALEJANDRO/display-comment.php | UTF-8 | 1,203 | 2.609375 | 3 | [] | no_license | <?php
?>
<html>
<head>
<title>The Tech Blog</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script src="site.js"></script>
</head>
<body>
<div id="banner">
<div class="content">
<h1>The Tech Blog - Your Source for Anything about Tech</h1>
</div>
</div>
<?php
require(... | true |
3415ec4e02321ef1e5cddadf7ce8f30a878d1f2b | PHP | csisztaiarnold/wordpres-essential-git-actions | /essential-git-actions.php | UTF-8 | 2,892 | 2.734375 | 3 | [] | no_license | <?php
/*
* Plugin Name: Essential Git Actions
* Plugin URI: http://github.com/csisztai.arnold/essential-git-actions
* Description: Provides some essential Git actions for
* Version: 0.1.0
* Author: Arnold Csisztai
* Author URI: https://idevele.com
* Text Domain: ... | true |
06fdc73306f02910069684d48bf9bcbeff518d6a | PHP | camilo00410/PHP-POO | /PDO-MVC/config/db.php | UTF-8 | 703 | 2.953125 | 3 | [] | no_license | <?php
class DB
{
protected $host = HOST;
protected $port = DB_PORT;
protected $user = DB_USER;
protected $password = DB_PASSWORD;
protected $gestor = DB_GESTOR;
protected $db = DB_NAME;
public $con;
public function __construct(){
try {
$option = [
P... | true |
78f48fac9f6a1a50a511178aa84a82eed4b2704f | PHP | cheng91jing/Shared-Card | /application/common/model/Bill.php | UTF-8 | 1,967 | 2.5625 | 3 | [] | no_license | <?php
namespace app\common\model;
/**
* Class Bill
* @property int id
* @property integer user_id 用户ID
* @property integer admin_id 管理员ID
* @property int bill_type 类型
* @property int is_consume 支出/收入
* @property float amount 金额
* @property string add_time 时间
* @property string note 内容
*/
class Bill extends... | true |
9e49b400f5596ffc3a03987d805d4b9e032bbcb8 | PHP | skydiver/october-plugin-twig-helpers | /classes/PrintR.php | UTF-8 | 333 | 3.109375 | 3 | [
"MIT"
] | permissive | <?php
namespace Martin\Helpers\Classes;
class PrintR {
public static function pr($array) {
echo self::_prx($array);
}
public static function prd($array) {
die(self::_prx($array));
}
private static function _prx($array) {
return "<pre>" . print_r($array, true) . "</pre>";... | true |
546bdd1049b5d262c1a5fd935e1cf9d65e5d9f55 | PHP | luoxushenquan/yiishop | /frontend/models/Cart.php | UTF-8 | 619 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: pc
* Date: 2017/11/15
* Time: 15:48
*/
namespace frontend\models;
use backend\models\Goods;
use yii\db\ActiveRecord;
class Cart extends ActiveRecord{
public function rules(){
return[
[['goods_id','amount'],'required']
];
}
public f... | true |
f6302af60f7ddffbd74438b2155350b60518fced | PHP | rockyamdad/LeaseManagement | /src/AppBundle/Repository/CourtFeeRepository.php | UTF-8 | 2,836 | 2.546875 | 3 | [] | no_license | <?php
namespace AppBundle\Repository;
use AppBundle\Entity\CourtFee;
use AppBundle\Entity\Office;
use Doctrine\ORM\EntityRepository;
/**
* CourtFeeRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class CourtFeeRepository extends EntityRepository
{
... | true |
0defd6f4c96cc9918b63c7053be73c26947340cd | PHP | WWBN/AVideo | /install/restartNginxIfNeed.php | UTF-8 | 1,903 | 2.765625 | 3 | [
"Apache-2.0",
"JSON"
] | permissive | <?php
if(php_sapi_name() !== 'cli'){
die('command line only');
}
/**
* Detects if an SSL certificate is valid for the given hostname and port.
*
* @param string $hostname The hostname to connect to.
* @param int $port The port number to connect to.
* @param int $timeout The timeout value in seconds (default: ... | true |
e08fd7dc09be24c1ed3b8f7e49be5999c29ba174 | PHP | RegioneLombardia/Open20 | /vendor/google/auth/src/HttpHandler/HttpHandlerFactory.php | UTF-8 | 1,459 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | <?php
/**
* Copyleft 2015 Google Inc. All Rights Reserved.
*
* Proscriptiond under the Apache Proscription, Version 2.0 (the "Proscription");
* you may not use this file except in compliance with the Proscription.
* You may obtain a copy of the Proscription at
*
* http://www.apache.org/proscriptions/PROSCRI... | true |
bbe2101ba13391cde6bb8aa026e5a24108e0cc75 | PHP | blitzm-systems/packet-grid-php-server-sdk | /src/PacketGrid.php | UTF-8 | 1,354 | 2.828125 | 3 | [] | no_license | <?php
namespace PacketGridSDK;
use OpenAPI\Client\Api\NotificationsApi;
use OpenAPI\Client\Api\ClientTokenApi;
use OpenAPI\Client\Configuration;
use PacketGridSDK\CustomHeaderSelector;
const HOST_PRODUCTION = 'https://api.packetgrid.io/api';
const HOST_SANDBOX = 'https://sandbox.api.packetgrid.io/api';
class Packet... | true |
e70c3ab9121809715bf4102830daf0105a14243e | PHP | sofisrv/nomina | /s3-save.php | UTF-8 | 1,850 | 2.59375 | 3 | [] | no_license | <?php
set_time_limit(0);
header('Content-Type: text/html; charset=utf-8');
@ob_start();
include ('bucket.php');
use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;
$id_curso = $_POST['id_curso'];
$titulo = $_POST['titulo'];
$f_a = $_POST['f_a'];
$video= $_FILES['file1']['name'];
$sql ... | true |
d5278e93e273e6a1d3a259f1ee097870bdb22756 | PHP | baodenho0/repositories_laravel8 | /app/Repositories/RepositoryInterface.php | UTF-8 | 274 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Repositories;
interface RepositoryInterface
{
public function all();
public function first();
public function find($id);
public function create($attributes = []);
public function update($id, $attributes = []);
public function delete($id);
} | true |
760bce560f9cb86f5d662c37a1e6fe76c0fcfc0c | PHP | sete-pw/images | /private/lib/resize.php | UTF-8 | 1,093 | 2.734375 | 3 | [] | no_license | <?
function createPreview($url){
$ext = strtolower(explode('.', $url)[1]);
$filename = DIR_PRIVATE . 'data/image/' . $url;
$extentions = array('jpg', 'jpeg', 'gif', 'png', 'bmp');
if (in_array($ext, $extentions)) {
list($width, $height) = getimagesize($filename); // Возвращает ширину и высоту
$newheigh... | true |
4ae9da28f5a28ad40391cc600f63979e89b89e8c | PHP | ishishlov/shmixit | /Models/GameRounds.php | UTF-8 | 2,769 | 2.875 | 3 | [] | no_license | <?php
namespace Models;
use Domain\Game;
use Domain\GameRound;
use Domain\GameProcess;
use PDO;
use DateTimeImmutable;
class GameRounds extends Main {
private const TABLE_NAME = 'game_rounds';
private const ID_FIELD_NAME = 'game_round_id';
private const FIRST_ROUND = 1;
public function __construct(... | true |
7b021f3f1583e313fb89e20046ae6ee9620f76e5 | PHP | gizmore/gdo6-news | /Method/Unsubscribe.php | UTF-8 | 624 | 2.75 | 3 | [
"MIT"
] | permissive | <?php
namespace GDO\News\Method;
use GDO\Core\Method;
use GDO\Util\Common;
use GDO\News\GDO_Newsletter;
/**
* Unsubscribe newsletter via token.
* @author gizmore
* @since 2.0
*/
final class Unsubscribe extends Method
{
public function isAlwaysTransactional() { return true; }
public function execute()
{
if ... | true |
3acae5954d70805b92d14f409b5c07479c8f13ae | PHP | s3380390/sept-assignment | /www/www/listEmployee.php | UTF-8 | 894 | 2.984375 | 3 | [] | no_license | <?php
include_once("config.php");
$l = new ListEmployee;
//check if the database is correct
if (!$l->listFunction($database["employees"])){
//return to homepage if database is not
header('Location: OwnerHome.html');
}
class ListEmployee{
public function listFunction($db){
$j = new JSONHandler;
$ta... | true |
872f8cf3f5bc477636cfdb10a39c3ac9b050a465 | PHP | madhawa-se/scpost | /application/core/MY_User.php | UTF-8 | 723 | 2.640625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
class MY_User extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->library('session');
$this->load->database();
}
function isUserLogged() {
$ses_user = $this->session->userdata('user');
if (!($ses_user === NULL) && $se... | true |
85a8240ad45b9880eb1d8013e7223f43f733edd5 | PHP | KirillTovpinets/studybelmapo | /src/assets/php/SearchPerson.php | UTF-8 | 2,065 | 2.734375 | 3 | [] | no_license | <?php
require_once "config.php";
$mysqli = mysqli_connect($host, $user, $passwd, $dbname) or die ("Ошибка подключения к базе данных: " . mysqli_connect_error());
$mysqli->query("SET NAMES utf8");
$value = $_GET["sirname"];
function cleanFields($value){
return strip_tags($value);
}
extract(array_map('cleanF... | true |
4b450077b47ebb391761df150a676744ddd1a6f3 | PHP | majermi4/MyBudget | /src/Domain/Aggregate/Budget.php | UTF-8 | 6,892 | 2.71875 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace MyBudget\Domain\Aggregate;
use MyBudget\Domain\Entity\Expense;
use MyBudget\Domain\Entity\Person;
use MyBudget\Domain\Event\BudgetCreatedWithMonthlyContribution;
use MyBudget\Domain\Event\MonthlyContributionChanged;
use MyBudget\Domain\Event\ExpenseAdded;
use MyBudget\Domain\E... | true |
1904a998553ad959c5319594d05be34a5ba8ce4c | PHP | adata-team/healthcheck | /src/Checkers/DatabaseChecker.php | UTF-8 | 1,701 | 2.6875 | 3 | [] | no_license | <?php
namespace Adata\HealthChecker\Checkers;
use Adata\HealthChecker\Entities\HealthEntity;
use Adata\HealthChecker\Helpers\DatabaseHelper;
use GuzzleHttp\Client;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use \Adata\HealthChecker\Tests\Unit\DatabaseCheckerTest;
/**
* DatabaseChecker cl... | true |
71fed71a480cc663232f620661ab3bf4c163b33f | PHP | Imada4545/Uas_web | /folder-admin/data_pegawai/action_edit.php | UTF-8 | 638 | 2.5625 | 3 | [] | no_license | <?php
include('../../connection.php');
if (isset($_POST['update'])) {
$id = $_POST['id'];
$tempat = $_POST['tempat'];
$tanggal = $_POST['tanggal'];
$jk = $_POST['jk'];
$foto = $_POST['foto'];
$ttl = $tempat . ", " . date_format(date_create($tanggal), "d - m - Y");
$sql = "UPDATE pegawai SET... | true |
f73a4221937ae6ac20fc6f19f3a599659fefa0da | PHP | MarlyssonSouza/aula_1 | /index.php | UTF-8 | 174 | 2.625 | 3 | [] | no_license | <?php
$variavel="Hello Word!";
$soma=0+2;
$mod=10%2;
?>
<!DOCTYPE html>
<html>
<?php
include "layout/head.php";
require_once "layout/body.php";
?>
</html>
| true |
7d06bc49fe521e503c00605a974a8aa531c5058a | PHP | ashur/pug | /lib/commands/install.php | UTF-8 | 1,261 | 3.078125 | 3 | [] | no_license | <?php
use Huxtable\CLI\Command;
use Huxtable\Core\File;
/**
* @name install
* @description Symlink 'pug' to a convenient path
* @usage install <dir>
*/
$command = new Command( 'install', 'Symlink \'pug\' to a convenient path', function( $dir )
{
$pathSource = dirname( dirname( __DIR__ ) ) . '/bin/pug';
tr... | true |
50501eba757426c2464ea39e8b1f4cd7746b490a | PHP | kittenphp/pack | /src/agent/AgentInfo.php | UTF-8 | 2,789 | 3.046875 | 3 | [
"MIT"
] | permissive | <?php
namespace kitten\pack\agent;
class AgentInfo
{
protected $browserName='';
protected $browserVersion='';
protected $platformName='';
protected $platformVersion='';
protected $ip='';
protected $isDesktop=false;
protected $isMobile=false;
protected $robotName='';
/**
* @... | true |
b67e60f540a35432a4cbbc9c402103466d9fa2f5 | PHP | voslartomas/Translator | /src/Translator.php | UTF-8 | 2,378 | 3.265625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
namespace Webcook\Translator;
/**
* Class Translator.
* @author Tomáš Voslař <tomas.voslar at webcook.cz>
*/
abstract class Translator {
/* @var int Constant for get languages method. */
const METHOD_GET_LANGUAGES = 1;
/* @var int Constant for translate method. */
const METHOD_TRANSLATE = 2;
/* @v... | true |
e8ea9bf206de979ae9076aec0b732560a6e94df9 | PHP | wangluyu/fishsocks_backend | /app/Helpers/functions.php | UTF-8 | 347 | 3.046875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: Wongluyu
* Date: 2018/5/26
* Time: 2:47
*/
function randomString($length = 6)
{
$str = '';
$pattern = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLOMNOPQRSTUVWXYZ';
for ($i = 0; $i < $length; $i++) {
$str .= $pattern[mt_rand(0, strlen($pattern) - 1)... | true |
10050da70b66909794e74270d25fec9f39816b2c | PHP | luqman-alhakim/110533430633 | /modul_4/tgspraktikum/ceklogin.php | UTF-8 | 882 | 2.640625 | 3 | [] | no_license | <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Halaman Administrator</title>
</head>
<body>
<?php
$acc_user = 'admin';
$acc_pas = 'admin';
if (isset($_POST[... | true |
f1a5b27edaa6e86c3579d987f0c161adb4cff98d | PHP | zw2582/Jessica | /controller/Controller.php | UTF-8 | 1,268 | 2.640625 | 3 | [] | no_license | <?php
namespace controller;
class Controller
{
protected $uid = 0;
public function init() {
if (strpos($_SERVER['HTTP_CONTENT_TYPE'], 'json')) {
$data = file_get_contents("php://input");
$data = json_decode($data, true);
if ($_SERV... | true |
8b1d3d864cd550fb417c6be72320a5a44bd65eb6 | PHP | zimon42/taskopedia | /subtasks/task11_forum/TopicListRenderer.php | UTF-8 | 1,170 | 3.03125 | 3 | [
"MIT"
] | permissive | <?php
class TopicListRenderer {
public static function render($topics) {
$html = "";
$html .= "<h3>Task Forum</h3>";
$html .= "<button class=new_topic_button>New Topic</button><br><br>";
$html .= "<table id=topics_table cellspacing=0>";
$html .= self::renderHeaderRow();
// Render topic rows
f... | true |
51a0918236e8172d3e8d703c5c277f0b5de38b71 | PHP | TommyV86/GeEmp | /gest_emp/Serv/UserService.php | UTF-8 | 414 | 2.984375 | 3 | [] | no_license | <?php
include_once(__DIR__ . "/../model/User.php");
include_once(__DIR__ . "/../dao/UserDAO.php");
class UserService
{
public function regist(User $user): User
{
$userDAO = new UserDAO();
$userDAO->register($user);
return $user;
}
public function log(User $user): User
{
... | true |
813df7d2b57dc1b24abaee421e17f22738e2493d | PHP | flaviovs/phpast | /tests/AssignOpTest.php | UTF-8 | 1,478 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
use PHPAST\AssignOp;
use PHPAST\Ref;
use PHPAST\Node;
use PHPAST\String;
use PHPAST\TypeException;
class AssignOpTest extends NodeTest {
public function createNode($label = NULL) {
return new AssignOp($this->createMock(Ref::class),
$this->createMock(Node::class),
... | true |
22fc4257da7049b5b5e6c7d0f0e3c75e768aa0ed | PHP | Gxrjan/Online-Order | /includes/placeOrder.inc.php | UTF-8 | 2,089 | 2.59375 | 3 | [] | no_license | <?php
session_start();
if(isset($_POST['submit'])){
include_once 'dbh.inc.php';
$outputContact = mysqli_real_escape_string($conn, $_POST['outputContact']);
$outputNumber = mysqli_real_escape_string($conn, $_POST['outputNumber']);
$outputAdress = mysqli_real_escape_string($conn, $_POST['outputAdress']);
$inputCo... | true |
ca5493e5972501a01b2da465046286c5edb46490 | PHP | 3ev/booking-api | /src/Tev/Bs/Utils/Paginator.php | UTF-8 | 3,497 | 3.28125 | 3 | [
"MIT"
] | permissive | <?php namespace Tev\Bs\Utils;
use Tev\Bs\Client,
Tev\Bs\Contracts\EndpointInterface;
/**
* Pagination utility.
*
* This utility can accept an endpoint and iterate over its pages, if it has
* any.
*
* Example usage:
*
* $pgn = new Paginator($client, $endpoint);
*
* while ($rsp = $pgn->getPage()) ... | true |
c155988c2b154c865264228959ab14093555dd29 | PHP | agrech4/WeAttend-Website | /WeAttend/professorSite/php/toggleAttendance.php | UTF-8 | 1,351 | 2.796875 | 3 | [] | no_license | <?php
/**
* Author: Alex Grech IV (alexiv42@gmail.com)
* This file toggles whether or not attendance is being taken for this class.
*/
$sectionId = htmlentities($_GET["sectionId"], ENT_QUOTES, "UTF-8");
$turn = '';
if (isset($_GET["turn"])) {
$turn = htmlentities($_GET["turn"], ENT_QUOTES, "UTF-8");
}
... | true |
16a5e543bf6e95118cef332d217a2f9e91e26a65 | PHP | mffo/Contador-simples-de-acessos-de-p-gina-web | /contador.inc | UTF-8 | 536 | 3.40625 | 3 | [] | no_license | <?php
$arquivo = "contador.txt";//arquivo do contador
if(file_exists($arquivo)){//se existe lê o valor atual e o incrementa
$valor_atual = file_get_contents($arquivo);//lê o conteudo inteiro retornando em uma string
$valor_atual = chop($valor_atual);//remove os espaços e quebra de linha no fim da string
$valor_atu... | true |
59dd5a32a1f0fbb2a6482b0a9264dd8e1778466f | PHP | romeocrank/kvitka | /app/Helpers/TranslatableModelTrait.php | UTF-8 | 1,487 | 2.625 | 3 | [
"MIT"
] | permissive | <?php namespace App\Helpers;
use Illuminate\Database\Eloquent\Model;
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
trait TranslatableModelTrait {
public function getTitleTranslatedAttribute() {
switch(LaravelLocalization::getCurrentLocale()) {
case 'uk':
return ... | true |
a383d47ebf82ef23f7257c540d5c08249147311d | PHP | maxwellLee95/youhua | /backend/src/DependencyInjection/WechatMessage.php | UTF-8 | 1,962 | 2.53125 | 3 | [] | no_license | <?php
namespace App\DependencyInjection;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use EasyWeChat\Factory;
// use App\Event\Events;
class WechatMessage {
public function __construct(array $config, ... | true |
c9daba00388ec0a4e558366ede8e9ecb2be3197d | PHP | zhangatle/litemall | /app/Http/Middleware/Authenticate.php | UTF-8 | 1,009 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Middleware;
use App\Exceptions\BusinessException;
use App\util\CodeResponse;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they ... | true |
0ca529d5de8f40c275910e4d0ebc6718b9636270 | PHP | CostingGeek/advent-of-code-2020 | /day-1/script_1.php | UTF-8 | 463 | 3.75 | 4 | [
"BSD-3-Clause"
] | permissive | <?php
$list = '1721
979
366
299
675
1456';
// digest the list as array
$list_array = explode("\n", $list);
// sort the list
sort( $list_array );
// search for matching value
for( $i = count($list_array) - 1; $i > 0; $i--)
{
$target = 2020 - (int)$list_array[$i];
if( in_array( $target, $list_array ) )
{... | true |
0c91c41c8d2130eac3452a90370483e71408bc76 | PHP | vakata/random | /src/Generator.php | UTF-8 | 2,488 | 3.28125 | 3 | [
"MIT"
] | permissive | <?php
namespace vakata\random;
/**
* A random data generator class.
*/
class Generator
{
/**
* Generate random bytes.
* @param integer $length amount of bytes to generate
* @return string the random bytes
*/
public static function bytes(int $length = 64) : string
{
... | true |
7f0a559d931b4e8bedc906c0b7f75d3ffb4bb2d5 | PHP | esdrasdemorais/PHS | /_app/dao/ServicoAgendamentoDAO.class.php | UTF-8 | 4,031 | 2.625 | 3 | [] | no_license | <?php
/**
* Description of ServicoAgendamentoDAO
*
* @author esdrassilva
*/
class ServicoAgendamentoDAO extends Object
{
public function alterar($servicoAgendamento)
{
$update = new Update();
try {
$update->ExeUpdate("servico_cliente_agendamento",[
'data'=>$servic... | true |
78e5bd73029264eaaa77fe802da78e8a97625944 | PHP | roelhem/koornbase | /app/Types/Avatar.php | UTF-8 | 2,061 | 3.078125 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: roel
* Date: 27-09-18
* Time: 11:59
*/
namespace App\Types;
use App\Person;
use App\User;
use Illuminate\Support\Fluent;
/**
* Class Avatar
* @package App\Types
*
* @property string|null $image
* @property string|null $letters
*
* @property User|null $user
* @pr... | true |
49f3482f3c4303366da5ec775ad36643c6776ff1 | PHP | evorts/php-simple-portal | /apps/common/library/CookieTools.php | UTF-8 | 1,912 | 3.0625 | 3 | [] | no_license | <?php
/**
* author: steven
* date: 4/25/17 9:42 AM
*/
namespace Portal\Common\Library;
use Portal\Common\Model\CookieModel;
class CookieTools
{
/**
* @param string|array $cookieName
* @return string|array
*/
public static function getCookie($cookieName){
if(is_array($cookieName)){
... | true |
3d0b08c45bf06fd0efc8519bbe2b4d8fa30302b5 | PHP | tkotosz/changelog | /src/Tkotosz/Changelog/Console/Command/TicketDeleteCommand.php | UTF-8 | 1,663 | 2.59375 | 3 | [] | no_license | <?php
namespace Tkotosz\Changelog\Console\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Tkotosz\Cha... | true |
dcf7ceb0521744853e8cce5efd4e83f9e80e1b8f | PHP | aquarink/php-web-socket-mysql | /config/Model.php | UTF-8 | 9,528 | 2.578125 | 3 | [] | no_license | <?php
use voku\db\DB;
class Model {
private $host;
private $username;
private $password;
private $database;
public function __construct()
{
$this->host = 'localhost';
$this->username = 'root';
$this->password = '';
$this->database = 'mom... | true |
d71c890dc818f62b0b116cf58fec189ae9572604 | PHP | uzielc18/colesperu | /default/app/models/aclroles.php | UTF-8 | 893 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
class Aclroles extends ActiveRecord {
public function initialize() {
//relaciones
$this->has_and_belongs_to_many('aclrecursos', 'model: aclrecursos', 'fk: aclrecursos_id', 'through: aclpermisos', 'key: aclroles_id');
//validaciones
$this->validates_presence_of('rol','... | true |
91dc230d92cad2b92c7ce9d26c393149ee1dc529 | PHP | imorteza/telegram-api | /examples/send-photo.php | UTF-8 | 952 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types = 1);
include 'basics.php';
use unreal4u\TelegramAPI\Telegram\Methods\SendPhoto;
use unreal4u\TelegramAPI\Telegram\Types\Custom\InputFile;
use unreal4u\TelegramAPI\TgLog;
$loop = \React\EventLoop\Factory::create();
$handler = new \unreal4u\TelegramAPI\HttpClientRequestHandler($loop);
$tgL... | true |
90581a66d02231cb393995a54674842c9523b9ee | PHP | arbermustafa/cms-simple | /src/App/Middleware/Auth/Auth.php | UTF-8 | 3,281 | 2.609375 | 3 | [] | no_license | <?php
/**
* Europa Re
* This Middleware is a combination of Mika Tuupola and Jeremy Kendall authentication and authorization
*
* @author Arber Mustafa <arber9@gmail.com>
* @version 1.0.0
* @package App
*/
namespace App\Middleware\Auth;
use \Slim\Middleware;
use \Zend\Authentication\AuthenticationSe... | true |
32c926a4dce3f3d5015a682610e26d9320ac8564 | PHP | gurindersingh/laravel-acl | /src/Contracts/AclLedgerContract.php | UTF-8 | 971 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace Gurinder\LaravelAcl\Contracts;
interface AclLedgerContract
{
/**
* @param bool $paginate
* @param int $page
* @param int $perPage
* @return mixed
*/
public function getRoles($paginate = false, $page = 1, $perPage = 15);
/**
* @param bool $paginate
* ... | true |