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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
183054281c5479fa9a096fd352ab9d90f1bbd452 | PHP | shenzt68/whmcs741 | /vendor/whmcs/whmcs-foundation/lib/Module/AbstractModule.php | UTF-8 | 9,520 | 2.859375 | 3 | [] | no_license | <?php
namespace WHMCS\Module;
abstract class AbstractModule
{
protected $type = "";
protected $loadedmodule = "";
protected $metaData = array( );
protected $moduleParams = array( );
protected $usesDirectories = true;
const FUNCTIONDOESNTEXIST = "!Function not found in module!";
public... | true |
14b8480285e8f64ad830c3b9413491d4b46fce72 | PHP | PratikumWebDasar4101/tamimodul6-ferdyps | /TA6/semuaposting.php | UTF-8 | 1,357 | 2.6875 | 3 | [] | no_license | <?php
require_once("db.php");
session_start();
include("header.php");
?>
<!DOCTYPE html>
<html>
<head>
<title>Daftar Postingan</title>
</head>
<body>
<table border="1">
<tr>
<th>Nama</th>
<th>NIM</th>
<th>Kelas</th>
<th>Fakultas... | true |
ce1dd860e701286d20859c8b80f9812c00e65825 | PHP | erwinade/coba | /views/sensors/select.php | UTF-8 | 1,883 | 2.640625 | 3 | [] | no_license | <?php
include '../../conn.php';
if(isset($_POST["employee_id"]))
{
$satuan='';
$output = '';
$query = "SELECT * FROM sensor WHERE id = '".$_POST["employee_id"]."'";
$result = mysqli_query($conn, $query);
$output .= '
<div class="table-responsive">
<ta... | true |
4131095a7371f687fe4799c1923b1573e1bf3a98 | PHP | ForjaOMF/OMF-PHPSDK | /classes/LocalizameAPI.php | UTF-8 | 8,927 | 2.703125 | 3 | [] | no_license | <?php
class Localizame
{
var $cookie;
// It makes login to the Web of copiagenda
// Input: login=string with number of telephone,
// passw=string with password of access to the Web
// Return: Necessary identifier of session for all the later operations
function Login($login, $pwd)
... | true |
c7080493afc4e7ec9004aede5c846d0d568df1d5 | PHP | przeslijmi/XlsxPeasant | /src/Exceptions/LookingForSpareIdLoopOtoranException.php | UTF-8 | 696 | 2.9375 | 3 | [] | no_license | <?php declare(strict_types=1);
namespace Przeslijmi\XlsxPeasant\Exceptions;
use Przeslijmi\Sexceptions\Exceptions\LoopOtoranException;
/**
* Generator was looking for spare id - but it failed after 10000 tries.
*/
class LookingForSpareIdLoopOtoranException extends LoopOtoranException
{
/**
* Constructor.... | true |
10cd940c4c2635e3e80cf64e3fadaa726dbad404 | PHP | rubends/web-backend-oplossingen | /opdracht-looping-statements-for/opdracht-looping-statements-for2.php | UTF-8 | 570 | 3.328125 | 3 | [] | no_license | <?php
$tafels = 10;
$product = 10;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>looping for</title>
<style>
.oneven { background-color : green; }
</style>
</head>
<body>
<h1>deel 2</h1>
<table>
<?php for ($i = 0; $i <= $tafels; $i++): ?>
<t... | true |
526bc33c7f6b7900386e31d39314650895c22257 | PHP | Clapiote/A2C | /src/A2C/PlatformBundle/Entity/ContactMessage.php | UTF-8 | 2,150 | 2.96875 | 3 | [
"MIT"
] | permissive | <?php
// src/A2C/PlatformBundle/Entity/ContactMessage.php
namespace A2C\PlatformBundle\Entity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* This object is used to build the contact form, when someone wants to send
* a message to the admin of the website.
*
* @author Vincent
*/
class ContactMess... | true |
1b9853806b3aa8103d7454b5d61dfcd5df0f9159 | PHP | daiphone0228/phppractice | /paiza20160413.php | UTF-8 | 5,044 | 3.21875 | 3 | [] | no_license | <?php
// 与えられる文字列の中にあるアルファベットを使用して、"cat"という文字が何個作れるかを出力する
// 与えられた文字列の中のアルファベットの各個数をsubstr_count()関数を使用して数える
// それらを格納した配列の中で最も大きい値を引っ張りだし、それを最大値として変数に代入する($max)
// for文を使用して、それぞれのアルファベットの数を引いていき、その時のループ回数を変数に代入する($catNum)
// このfor文内で"c","a","t"のいづれかの値が0になった時に、if文を抜ける
// つまり、catという単語が作れなくなった時に条件分岐から外れる
// さらに、1... | true |
5150e36dd9a12d04df6b2d48515f8c743f76385f | PHP | Hetystars/swoole-src | /tools/gen-data.php | UTF-8 | 224 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env php
<?php
$fp = fopen(__DIR__ . "/test.txt", "w");
ftruncate($fp, filesize(__DIR__ . "/a.txt"));
fwrite($fp, str_repeat('A', 1024));
fwrite($fp, str_repeat('B', 1024));
fwrite($fp, str_repeat('C', 256)."\n");
| true |
845e109a307148e1c77e3302eea2e23a43bfd5b4 | PHP | michaelhoanglong/wovodat-EOS | /PEAR/php/funcs/upload_form_funcs.php | UTF-8 | 5,063 | 2.875 | 3 | [] | no_license | <?php
/******************************************************************************************************
*
* Package of functions for operations on upload forms
*
* html_write_form_line: Function to write a line in the form
*
****************************************************************************************... | true |
b2ccf81195992858221fc803b6fd35492c6e56ef | PHP | WojtekWiedenski/szukajnapcz | /database/seeds/GeneratorObiektowSeeder.php | UTF-8 | 859 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Seeder;
class GeneratorObiektowSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$faker=Faker\Factory::create();
foreach(range(1,50) as $index){
DB::table('objects')->insert([
... | true |
d8591bc089e5c651088d707173610d3dd22ddafd | PHP | Tyka95/Asigurare | /admin/add-user.php | UTF-8 | 3,027 | 2.96875 | 3 | [] | no_license | <?php
$username = '';
$password ='';
$email ='';
$type = '';
$errors = array();
$data = false;
// Daca forma nu a fost trimisa si avem un ID, atunci editam utilizatorul
if( empty($_POST) && !empty($_GET['id']) ){
$data = get_user_by_id( intval($_GET['id']) );
}
// Primeste detaliile din post
if( empty($data) ){
$d... | true |
5e9a314fbe360d9d49f2e9fefe8622ed7f0d288a | PHP | thenx-projects/thenx-discuz | /source/plugin/witframe_api/lib/crypt.php | UTF-8 | 2,469 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | <?php
if (!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class Crypt {
protected static $_key = null;
protected static $_hashAlgorithm = 'md5';
protected static $_supportedMhashAlgorithms = array('adler32', ' crc32', 'crc32b', 'gost',
'haval128', 'haval160', 'haval192', 'haval256', 'md4', 'md5', 'ripemd16... | true |
820ca30292bc9e6b5d320d27321c401874d0fd42 | PHP | Serbasik/analiz | /models/Region.php | UTF-8 | 1,586 | 2.609375 | 3 | [] | permissive | <?php
namespace app\models;
use Yii;
/**
* This is the model class for table "region".
*
* @property string $id
* @property string $RegionName
* @property string $okrug
* @property int $BuildYear
*
* @property IndicatorData[] $indicatorDatas
* @property Period $buildYear
*/
class Region extends \yii\db\Act... | true |
7621b939596d0d828230366a1f9bc7523abe9fa1 | PHP | fhferreira/dranzer | /app/Builders/PHP/Laravel/Preprocessors/MutationsPreprocessor.php | UTF-8 | 13,342 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Builders\PHP\Laravel\Preprocessors;
use Illuminate\Support\Str;
use App\Builders\Helpers\MutationHelpers;
use App\Services\Mutation\MutationService;
/**
* Class MutationsPreprocessor
* @package App\Builders\PHP\Laravel\Preprocessors
*/
class MutationsPreprocessor
{
/**
* @var
*/
... | true |
70bf5c2ca99bffd641fe30e52beea996fab1fe9e | PHP | opensource-workshop/connect-cms | /app/Models/Migration/Nc3/Nc3User.php | UTF-8 | 1,355 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models\Migration\Nc3;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
class Nc3User extends Model
{
/** ステータス */
const
status_active = 1,
status_not_active = 0;
/** 権限 */
const
role_system_administrator = 'system_administrator', ... | true |
a3e5b7c56697d918862d5a3a057999cb79b7afce | PHP | yanirahauchbaum/pw2163 | /examen3/php/utilerias.php | UTF-8 | 2,375 | 2.875 | 3 | [] | no_license | <?php
//Limpiar parámetros - contra ataques
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue)... | true |
5fa7c7d8941e6626a0a97372b491308c4ee38898 | PHP | freedom5566/codewars | /7kyu/fundamentals/基礎/0Moves_in_squared_strings_I/php/best.php | UTF-8 | 268 | 2.71875 | 3 | [] | no_license | <?php
function vertMirror($s) {
return implode(PHP_EOL,array_map('strrev', explode(PHP_EOL,$s)));
}
function horMirror($s) {
return implode(PHP_EOL,array_reverse(explode(PHP_EOL,$s)));
}
function oper($f, $s) {
if (is_callable($f)) return $f($s);
} | true |
0dbf9aa3e19d207ab2c410e0286657a590e56c48 | PHP | xxMAGRAOxx/redevistorias-test | /vendor/ClientSide/Server/Connect.php | UTF-8 | 892 | 2.625 | 3 | [] | no_license | <?php
/**
* Created by Carlos Magno
* User: Carlos Magno
* Contact: cmagnosoares@gmail.com
* Github: https://github.com/xxMAGRAOxx
*
*
*/
namespace ClientSide\Server;
/**
* Class Connect
* Nothing to do here for while.
* @package BBM\Server
*/
class Connect
{
public $verbose;
protected $data;
... | true |
60bf32825889af4ecc94b7589d8ee55d0aa74604 | PHP | designinlife/aplite | /src/APLite/Web/WebControllerBase.php | UTF-8 | 1,832 | 2.984375 | 3 | [] | no_license | <?php
namespace APLite\Web;
use APLite\Base\AbstractWebBase;
use APLite\Interfaces\IController;
use APLite\Interfaces\ITemplate;
/**
* 基于 Web 开发的控制器基类。
*
* @package APLite\Web
* @author Lei Lee <web.developer.network@gmail.com>
* @version 1.0.0
* @copyright (c) 2013-2016, Lei Lee
*/
class We... | true |
804b3932ad6a16242bfaa1ee689569d0de793140 | PHP | davewwww/Tracedump | /src/Dwo/Tracedump/Drawer/MethodDrawer.php | UTF-8 | 3,277 | 3.03125 | 3 | [] | no_license | <?php
namespace Dwo\Tracedump\Drawer;
use Dwo\Tracedump\Styler\StylerInterface;
/**
* @author Dave Www <davewwwo@gmail.com>
*/
class MethodDrawer implements DrawerInterface
{
const IDENTS = 4;
/**
* @var StylerInterface
*/
protected $styler;
/**
* @param StylerInterface $styler
... | true |
9fc3686e8ae8d5955a473a58ea51973bbc675c3f | PHP | andrmax/web181 | /home-work/2018-07-12/serkov_zb/index7.php | UTF-8 | 682 | 3.59375 | 4 | [] | no_license | <?php
/**
* Date: 16.07.2018
* Zakhar Serkov <zakharserkov@me.com>
*/
/*Задание:
Дан массив $arr. С помощью цикла foreach запишите английские названия в массив $en, а русские - в массив $ru.
*/
$arr = array(
'green' => 'зеленый',
'red' => 'красный',
'blue' => 'голубой'
);
$en = array();
$ru = array();
... | true |
36b07ae8ce98a625fb38064658423abec3959f6e | PHP | jackweinbender/bhal-demo-api | /database/seeds/LettersTableSeederProduction.php | UTF-8 | 842 | 3.265625 | 3 | [] | no_license | <?php
use Illuminate\Database\Seeder;
use App\Letter;
class LettersTableSeederProduction extends Seeder
{
/**
* Seeds the 'Letters' table with the current API data from Heroku
*
* @return void
*/
public function run()
{
// Sets input file
$input = storage_path('seeds/le... | true |
e4ceaa7eae6a4a927b8a49d1105174f4636fb1d5 | PHP | 1833918689/laravel-tars-shop | /src/app/Tars/cservant/PaySystem/PayService/PayObj/classes/ComplicatedStruct.php | UTF-8 | 927 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Tars\cservant\PaySystem\PayService\PayObj\classes;
class ComplicatedStruct extends \TARS_Struct {
const SS = 0;
const RS = 1;
const MSS = 2;
const STR = 3;
public $ss;
public $rs;
public $mss;
public $str;
protected static $_fields = array(
self::SS => array(
'name'=>'ss',
... | true |
d25e017778a270cbd39c7c34e1f2ad7570d08624 | PHP | otengkwame/coroutine | /wiki/dev.io/concurrent.php | UTF-8 | 1,294 | 2.8125 | 3 | [
"MIT"
] | permissive | <?php
include 'vendor/autoload.php';
use function Async\Path\file_get;
use function Async\Stream\{messenger_for, net_accept, net_close, net_local, net_response, net_server, net_write};
const WEB_DIR = __DIR__ . DS;
function main($port)
{
$count = 0;
$server = yield net_server($port);
print('Server is running ... | true |
bcf8dff3165059551d1fb11147e7385c5de3452f | PHP | dzemba1986/servnet_old | /core/classes/mysqlPstmt.php | UTF-8 | 6,538 | 3.09375 | 3 | [] | no_license | <?php
class MysqlPstmt
{
public $mysqli;
public $result;
public $num_rows;
public function connect_pl($host, $user, $password, $database)
{
if(!$this->mysqli)
{
$this->mysqli = new mysqli($host, $user, $password, $database);
if (mysqli_connect_errno()) {
pr... | true |
22752570da5453d6962f0ff6b4c45e74a5d5ebfb | PHP | sux789/idea | /application/common/service_client/CacheHandle.php | UTF-8 | 1,570 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace app\common\service_client;
use think\facade\Cache;
/**
* 对路径和参数为键缓存服务执行结果
* @todo 提供注入缓存键处理器,缓存键可能是数组用于支持集合,但还没处理
*/
class CacheHandle extends BaseHandle
{
/**
* handle
* @return mixed
*/
public function handle()
{
$hasCached = true; //把读缓存和判断是否缓存分开,减少一次检查缓存是否存在
... | true |
bb2a898ef652815820bfaa8bb2d1d33522b93fc7 | PHP | oaattia/phpstan | /src/Type/Constant/ConstantArrayType.php | UTF-8 | 7,235 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php declare(strict_types = 1);
namespace PHPStan\Type\Constant;
use PHPStan\Broker\Broker;
use PHPStan\TrinaryLogic;
use PHPStan\Type\ArrayType;
use PHPStan\Type\BooleanType;
use PHPStan\Type\CompoundType;
use PHPStan\Type\ConstantType;
use PHPStan\Type\ErrorType;
use PHPStan\Type\MixedType;
use PHPStan\Type\Type;
... | true |
4dcf5e12e07fcc3b015f018ab125b0179f25d0f4 | PHP | lukelukic/laravel-simple-blog-example | /app/Http/Controllers/CommentsController.php | UTF-8 | 2,409 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use App\Models\CommentsModel;
use Illuminate\Database\QueryException;
use Illuminate\Http\Request;
class CommentsController extends Controller
{
public function postComment(Request $request, $postId)
{
if ($request->get("content")) {
$commentsModel = ... | true |
f98e41690dd9df631e69aaf5aef0d08b659972d8 | PHP | walterlize/ssyz | /application/models/m_award.php | UTF-8 | 2,850 | 2.640625 | 3 | [] | no_license | <?php
class m_award extends CI_Model{
var $awardId = '';
var $subjectId = '';
var $state = '';
var $awardName = '';
var $author = '';
var $workplace = '';
var $type = '';
var $grade = '';
var $level = '';
var $awardState = '';
var $processWorkplace = '';
var $organizatio... | true |
30b80d66ca6c0bdb8f8a9598b2cd5ab183d076ea | PHP | mfigaredo/laravel58-blog | /app/Http/Requests/SaveRolesRequest.php | UTF-8 | 1,119 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Gate;
class SaveRolesRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return mixed
*/
public function authorize()
{
r... | true |
1c39ee53e37a3236bf66dbc93510e0aa73ff5bbc | PHP | alexzvn/moneybooster-mcpe | /src/Alexzvn/MoneyBooster/Drivers/BoosterResponse.php | UTF-8 | 524 | 2.9375 | 3 | [] | no_license | <?php
namespace Alexzvn\MoneyBooster\Drivers;
use Alexzvn\MoneyBooster\Contracts\BoosterResponseContract;
abstract class BoosterResponse implements BoosterResponseContract
{
protected string $response;
/**
* data after decode
*
* @var \stdClass
*/
protected $data;
public functio... | true |
36be619d3a9860942ed173441b6f02305e755511 | PHP | Fragorite/cms_web | /administration/changeTemplate.php | UTF-8 | 2,320 | 2.78125 | 3 | [] | no_license | <?php include('../includes/config.php'); // Configuration générale ?>
<?php
$searchWebsiteConfig = $db->query('SELECT * FROM website');
$websiteConfig = $searchWebsiteConfig->fetch(PDO::FETCH_ASSOC);
if(isset($_POST['formTemplateChange'])){
if(!empty($_POST['templateChoice'])){
if(($web... | true |
88987a416881ce91ed4017097f1a253d1cc45573 | PHP | crudle-apps/entity | /src/Identity/Uuid.php | UTF-8 | 1,304 | 3.09375 | 3 | [
"MIT"
] | permissive | <?php
namespace Crudle\Entity\Identity;
use Ramsey\Uuid\Uuid as BaseUuid;
class Uuid implements \JsonSerializable
{
/**
* @var BaseUuid
*/
private $inner;
/**
* @param $string
*/
public function __construct($string)
{
$this->inner = BaseUuid::fromString($string);
... | true |
93cfe207d0715bd1c343d940e13e6cd1792c2d74 | PHP | gCardinal/tdd-coaching | /spec/Unit/FizBuzzStringPrinterSpec.php | UTF-8 | 827 | 2.953125 | 3 | [] | no_license | <?php
namespace spec\Unit;
use FizBuzz;
use FizBuzzStringPrinter;
use Phake;
use Phake_IMock;
use PhpSpec\ObjectBehavior;
class FizBuzzStringPrinterSpec extends ObjectBehavior {
/**
* @var FizBuzz|Phake_IMock
*/
private $fizBuzz;
public function let() {
$this->fizBuzz = Phake::mock(FizBuzz::class);... | true |
4e13485f5d0526e98fd5462b7aed4c5d9307f8cb | PHP | YEK-PLUS/Firsatim | /src/admin-functions.php | UTF-8 | 725 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | <?php
function __($data){
return (
( isset($_POST[$data]) )
?$_POST[$data]:null
);
}
function ___($data){
return (
( isset($_SESSION[$data]) )
?$_SESSION[$data]:null
);
}
function login(){
global $DB;
$db = $DB;
$username = (
(__("username") != null)
?__("username"):___("username") );
$pass = __("... | true |
97eee796950568c9fc7df9514bc2b437f497fc38 | PHP | Dev-Pledge/API | /src/Application/CommandHandlers/DeleteFollowHandler.php | UTF-8 | 1,156 | 2.765625 | 3 | [] | no_license | <?php
namespace DevPledge\Application\CommandHandlers;
use DevPledge\Application\Commands\CreateFollowCommand;
use DevPledge\Application\Commands\DeleteFollowCommand;
use DevPledge\Framework\ServiceProviders\FollowServiceProvider;
use DevPledge\Integrations\Command\AbstractCommandHandler;
use DevPledge\Integrations\... | true |
f9c5f8fed4e112e48e7e7bf9ca10f9d7de92e251 | PHP | devsnippet/QuizGenerator | /php/save-quiz.php | UTF-8 | 2,090 | 2.875 | 3 | [
"Apache-2.0"
] | permissive |
<?php
include "database.php";
$jsonQuiz = file_get_contents('php://input');
$data = json_decode($jsonQuiz, false);
$name = $data->name;
$id = $data->id;
$questions = $data->questions;
$conn = new mysqli("localhost", $username, $password, "quiz_website");
if($conn->connect_error){
echo("Connection failed" . $conn... | true |
8b5691249d51935c3e3aa9dd9d30d453a0f9eaac | PHP | Makae/ch.bfh.bti7054.w2014.q.groot | /trunk/playground/grootProdSchwf5/classes/models/class.order.php | UTF-8 | 243 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | <?php
class OrderModel extends BaseModel {
protected static $TABLE = 'order';
protected static $COLUMN_NAMES = array('user_id', 'datetime');
protected static $COLUMN_TYPES = array('INT(10) NOT NULL', 'DATETIME NOT NULL');
}
?> | true |
357d869dd1269cd2cda02ddee4e51e5312c3a178 | PHP | leakon/simple-web-service | /new_service/matcher/project/lib/Events/SofavEvent_Base.php | UTF-8 | 1,133 | 2.78125 | 3 | [] | no_license | <?php
/**
* SofavEvent_Base
*
* @package Event
* @subpackage Base
* @link www.leakon.com
* @version 2009-03-25
* @author Leakon <leakon@gmail.com>
* @description 事件处理,有些用户操作,需要连续对多个 map 表进行写操作,这里可以统一处理,避免疏漏,同时生成备查日志
*
* @notice add comment
*/
class SofavEvent_Base {
pr... | true |
f870fb5eaf6517f749c9ef5bb2fbdbb0e9c99ba9 | PHP | r3wald/switchbox | /lib/SwitchBox/Iface/Admin/Commands/Seek.php | UTF-8 | 1,680 | 2.875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace SwitchBox\Iface\Admin\Commands;
use SwitchBox\Iface\SockHandler;
use SwitchBox\Packet\Line\Channel;
use SwitchBox\SwitchBox;
use SwitchBox\Packet\Line\Processor\Seek as LineSeek;
class Seek implements iCmd {
/**
* @param SwitchBox $switchbox
* @param SockHandler $handler
* @param ... | true |
3c54038b1c4ffaf5eb4187488f42c73e02e07abc | PHP | ynijar/products | /app/helpers/Response.php | UTF-8 | 1,001 | 3.078125 | 3 | [] | no_license | <?php
class Response
{
public $status, $code, $errors, $data;
const STATUS_SUCCESS = 200;
const STATUS_FORBIDDEN = 403;
const STATUS_SERVER_ERROR = 500;
const STATUS_BAD_REQUEST = 400;
const STATUS_CREATED = 201;
const CODE_OK = 'ok';
const CODE_ERROR = 'error';
public func... | true |
260995cc8ccf9394804d6d72a8886da091651967 | PHP | oodies/oc_blog | /src/blogpost/Infrastructure/Service/PostReadService.php | UTF-8 | 1,065 | 2.875 | 3 | [
"MIT"
] | permissive | <?php
/**
* This file is part of oc_blog project
*
* @author: Sébastien CHOMY <sebastien.chomy@gmail.com>
* @since 2017/12
*/
namespace Blogpost\Infrastructure\Service;
use Blogpost\Domain\Model\Post;
use Blogpost\Domain\ValueObject\PostID;
use Blogpost\Infrastructure\Persistence\CQRS\PostReadRepository;
/**
... | true |
b00a3992ce0fcdffe8e1a71d89f31559f7129546 | PHP | cezar08/tdd | /anotações/Depends.php | UTF-8 | 600 | 2.796875 | 3 | [] | no_license | <?php
class PilhaTest extends PHPUnit_Framework_TestCase
{
public function testVazio()
{
$pilha = array();
$this->assertEmpty($pilha);
return $pilha;
}
/**
*@depends testVazio
*/
public function testPush(array $pilha)
{
array_push($pilha, 'foo');
$this->assertEqua... | true |
aaa7a8269c54a996f3b3b3e878f75891f1e8eec6 | PHP | general03/f-design-pattern-php | /command.php | UTF-8 | 1,254 | 3.4375 | 3 | [] | no_license | <?php
class Log {
private $_severity;
private $_message;
public function __construct($message, $severity)
{
$this->_message = $message;
$this->_severity = $severity;
}
public function display(){
return array($this->_severity, $this->_message);
}
}
interface InfoC... | true |
6617527c939c33d6ee6234b97a62bbbfab8d0237 | PHP | emilraykov/clippingsChallenge | /tests/CurrencyConverterTest.php | UTF-8 | 864 | 2.625 | 3 | [] | no_license | <?php
use Lib\CurrencyConverter;
use PHPUnit\Framework\TestCase;
class CurrencyConverterTest extends TestCase
{
private $inputValidator;
private $currencyConverter;
public function setUp(): void
{
$this->inputValidator = new \Lib\InputValidator();
$this->currencyConverter = new Curren... | true |
437954e9dd0ee6865a6c107a649f67e5f789e167 | PHP | Varis-husen/BrainTester | /php and node file/showRetrofitData.php | UTF-8 | 834 | 2.828125 | 3 | [] | no_license | <?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "braintrainervaris";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if($_SERVER['REQUEST_METH... | true |
78125feea5e01269a3f7848768c1c342ef23c3ad | PHP | zulfajuniadi/laravel-base | /app/Libraries/Menu/Menu.php | UTF-8 | 881 | 2.734375 | 3 | [] | no_license | <?php
namespace App\Libraries\Menu;
use Closure;
class Menu
{
private $menus = [];
private $registered = [];
public function handler($name)
{
if(!isset($this->menu[$name])) {
$this->menu[$name] = new MenuHandler();
}
return $this->menu[$name];
}
public fu... | true |
47e7214be81db5e0253960d61dded9dbbdcaf5d1 | PHP | trsmash/targetcase | /app/Repositories/Repository.php | UTF-8 | 805 | 3.015625 | 3 | [] | no_license | <?php namespace App\Repositories;
use App\Contracts\Model;
use Exception;
/**
* Class Repository
* @package App\Repositories
*
* Abstract class that contains generalized application logic for CRUD operations against models and other helpers
*/
abstract class Repository
{
/**
* @var Model
*/
pro... | true |
950e79c9263e16e6731485326ccd5d0f58bf6cb0 | PHP | ranmavn22/asiav2 | /includes/sidebar.php | UTF-8 | 10,217 | 2.625 | 3 | [] | no_license | <?php if (is_category(89)) {
$args = array('orderby' => 'name', 'parent' => 89, 'exclude' => array(1, 89));
$categories = get_categories($args);
if ($categories)
foreach ($categories as $term) {
?>
<aside id="category-<?php echo $term->term_id ?>" class="widget">
... | true |
42617c843ad39252fc07bb906a6943868a962dbc | PHP | szeidler/pageplanner | /src/PageplannerClientFactory.php | UTF-8 | 1,209 | 2.625 | 3 | [] | no_license | <?php
namespace Drupal\pageplanner;
use Drupal\Core\Config\ConfigFactoryInterface;
use szeidler\Pageplanner\PageplannerClient;
/**
* Class PageplannerClientFactory.
*/
class PageplannerClientFactory {
/**
* The config factory.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $confi... | true |
1640ea3f0f8bc9ab9b07d1403f058c4c3327203a | PHP | Benfarhat/CID | /config.php | UTF-8 | 1,093 | 2.5625 | 3 | [] | no_license | <?php
return [
// Comment on instancie PDO
// Pour comprendre:
// @see: https://github.com/PHP-DI/PHP-DI/issues/395
// Si il y a une variable d'environnement depuis PHP, il faut l'utiliser
'db.username' => \DI\env('db_username', 'root'),
'db.password' => \DI\env('db_password', ''),
'db.ho... | true |
a2a45a78ecbe69d0c73c2aa6de91a87df2419a4f | PHP | nucleos/NucleosUserBundle | /src/Util/UserManipulator.php | UTF-8 | 1,093 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of the NucleosUserBundle package.
*
* (c) Christian Gripp <mail@core23.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Nucleos\UserBundle\Util;
use Nucleos\UserBundle\Model\UserInterfac... | true |
a647145449938adc0b57bf832b431fd500d9c18f | PHP | lotharthesavior/masadb | /src/Controllers/OAuthController.php | UTF-8 | 4,485 | 2.59375 | 3 | [] | no_license | <?php
namespace Controllers;
use DateInterval;
use Exception;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Models\Repositories;
use Models\Generic;
use Models\OAuth2\Clients;
use Models\Users;
use League\OAuth2\Server\AuthorizationServer;
use League\OAuth2\Server\CryptKe... | true |
69803bc90d87bf74e850023532ed12912b558c80 | PHP | anotherNick/database | /lib/migrate/src/Migrate.php | UTF-8 | 6,922 | 2.703125 | 3 | [] | no_license | <?php
namespace Migrate;
use R as R;
class Migrate
{
private $environment = null;
private $environments = null;
private $files = null;
private $migrationsDir = null;
private $quiet = false;
private $table = null;
private $target = null;
private function connectDb()
{
$env =... | true |
00bda18b9ed77705524e11a33839191182ea9a62 | PHP | CarolineKowalski/plusieurs_pages | /exercice_perso/template.php | UTF-8 | 4,627 | 2.65625 | 3 | [] | no_license | <?php
// Credentials
define('BE2BILL_PASSWORD', 'S+.Es1(=FNk7W)91' ); // <--- sent by email
//var_dump($_POST);
$IDENTIFIER = $_POST['IDENTIFIER'];
$OPERATIONTYPE = $_POST['OPERATIONTYPE'];
$ORDERID = $_POST['ORDERID'];
$AMOUNT= $_POST['AMOUNT']/100;
$CLIENTIDENT = $_POST['CLIENTIDENT'];
$DESCRIPTION = $_POST['DESCR... | true |
39e786529209222742b89666b6a5c1f04a76e55c | PHP | abogado93/biblioteca | /proyecto/vendor/tebru/gson-php/tests/Unit/Internal/JsonObjectIteratorTest.php | UTF-8 | 2,766 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
/*
* Copyright (c) Nate Brunette.
* Distributed under the MIT License (http://opensource.org/licenses/MIT)
*/
namespace Tebru\Gson\Test\Unit\Internal;
use PHPUnit_Framework_TestCase;
use Tebru\Gson\Element\JsonObject;
use Tebru\Gson\Element\JsonPrimitive;
use Tebru\Gson\Internal\JsonObjectIterator;
/**
* Cl... | true |
5ca8bdf027da8b51a6e1d56d807cff37341b02ae | PHP | murase-msk/YoutubeTypingGameGenerator | /src/validation.php | UTF-8 | 1,035 | 2.59375 | 3 | [] | no_license | <?php
use Respect\Validation\Validator as v;
// TODO 正規表現を使う
// TODO dependency.php に入れれない?
//v::countryCode()->validate('JP');
// xxx@xxx.xxx(xxxは先頭アルファベットかつ50字以内)
$emailValidator = v::notBlank()->email()->setTemplate('メールアドレスの形式が正しくありません');
//$emailValidator = v::regex('/^[a-z]$/')->setTemplate('カスタムメッセージ');
// ... | true |
c463f1ce41d47a673f24fd96f04f736624bcac0a | PHP | KkyJim12/offline-course-marketplace | /database/migrations/2018_08_13_200842_create_study_table.php | UTF-8 | 1,358 | 2.546875 | 3 | [] | no_license | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateStudyTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('study', function ... | true |
6a6c99ff97bb4222d905426557a188233846a922 | PHP | d0x2f/CloverMerge | /src/Metrics.php | UTF-8 | 5,573 | 3.015625 | 3 | [
"MIT"
] | permissive | <?php
namespace d0x2f\CloverMerge;
/**
* Represents a set of metrics.
*/
class Metrics
{
/** @var integer */
public $statement_count = 0;
/** @var integer */
public $covered_statement_count = 0;
/** @var integer */
public $conditional_count = 0;
/** @var integer */
public $covered... | true |
f726032b4870838e6e33e5f066610a2076187d93 | PHP | MissionNext/mn-api | /app/controllers/Api/AppConfig/UserConfigController.php | UTF-8 | 2,191 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
namespace MissionNext\Controllers\Api\AppConfig;
use MissionNext\Api\Response\RestResponse;
use MissionNext\Controllers\Api\BaseController;
use MissionNext\Models\Configs\UserConfigs;
/**
* Class UserConfigController
*
* @package MissionNext\Controllers\Api\AppConfig
*/
class UserConfigController extends ... | true |
6578b924bd0fda038deb38941c6e49d1e510492a | PHP | LucasGustavo088/Ajax-CRUD-Laravel-5.4---Sistema-Coment-rios | /app/Http/Controllers/Painel/ProdutoController.php | UTF-8 | 3,772 | 2.640625 | 3 | [] | no_license | <?php
namespace App\Http\Controllers\Painel;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\Painel\Product;
class ProdutoController extends Controller
{
private $product;
public function __construct(Product $product){
$this->product = $product;
}
/**
*... | true |
a86ea29a443c0f4e4d60caf03d635dd50deab8ff | PHP | CycloneDX/specification | /tools/src/test/php/xml-schema-functional-tests.php | UTF-8 | 2,892 | 2.578125 | 3 | [
"LicenseRef-scancode-free-unknown",
"Apache-2.0"
] | permissive | <?php declare(strict_types=1);
/**
* validate all test data for a given version of CycloneDX.
* call the script via `php -f <this-file> -- -v <CDX-version>`
*/
use Opis\JsonSchema;
require_once __DIR__ . '/vendor/autoload.php';
// region config
define('TESTSCHEMA_VERSION', getopt('v:')['v']);
define('SCHEMA_DIR... | true |
8a5fce996d979ce6061e65a7bc5d8c06ab2d6bf7 | PHP | digiaonline/graphql-php | /tests/Unit/Util/NameHelperTest.php | UTF-8 | 1,183 | 2.578125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
namespace Digia\GraphQL\Test\Unit\Util;
use Digia\GraphQL\Test\TestCase;
use Digia\GraphQL\Util\NameHelper;
/**
* Class NameHelperTest
* @package Digia\GraphQL\Test\Unit\Util
*/
class NameHelperTest extends TestCase
{
/**
* @expectedException \Digia\GraphQL\Validation\ValidationException
* @... | true |
369df127dcc44f9ed63f6315205b4d9c72dafe31 | PHP | kafruhs/fws | /base/php/cache/Fieldinfo.php | UTF-8 | 1,607 | 2.84375 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: User
* Date: 05.02.2015
* Time: 16:32
*/
class base_cache_Fieldinfo implements base_interface_Singleton
{
static private $_instance = null;
/**
* @var array
*/
protected $cache;
public static function get()
{
if (is_null(self::$_inst... | true |
9adc7360ad174eba63f3108667f610d604bd210e | PHP | jmhobbs/K3-Faker | /classes/kohana/faker/name.php | UTF-8 | 1,052 | 3 | 3 | [
"MIT"
] | permissive | <?php defined('SYSPATH') or die('No direct script access.');
/*!
Fake Name data.
Don't access directly, instead use the Faker class.
\code
Faker::Name()->first
\endcode
*/
class Kohana_Faker_Name extends Kohana_Faker_Module {
protected static $FIRST_NAME = null;
protected static $LAST_NAME = null;
... | true |
148d81b3a496fefed55fef870182eba1bb514dc1 | PHP | pdepend/pdepend | /src/test/resources/files/Source/Language/PHP/Features/PHP81/FirstClassCallable/testFirstClassCallableDynamicMethod.php | UTF-8 | 106 | 2.875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
class Foo
{
public function bar($obj, $method)
{
return $obj->$method(...);
}
}
| true |
0454798bce15af87eb8d9eaaef2602294c1327b6 | PHP | lihuaba/product | /shell/change_online_by_source.php | UTF-8 | 2,559 | 2.578125 | 3 | [] | no_license | <?php
require_once dirname(__FILE__) . '/../init.inc.php';
$params = Cmd::getParams($argv);
$file = $params['file'];
$statusProduct = $params['online_status'] == 'offline'
? Product_OnlineStatus::OFFLINE
: Product_OnlineStatus::ONLINE;
$statusGoods = $params['o... | true |
60211d100f488f662b02671892216cb7d85263b1 | PHP | fracz/refactor-extractor | /results/Elgg--Elgg/14f5dd0e69e31c4f5763cc1ab9c6d4e7c706e47e/after/HooksRegistrationService.php | UTF-8 | 6,105 | 3.09375 | 3 | [] | no_license | <?php
namespace Elgg;
/**
* Base class for events and hooks
*
* @access private
*/
abstract class HooksRegistrationService {
const REG_KEY_PRIORITY = 0;
const REG_KEY_INDEX = 1;
const REG_KEY_HANDLER = 2;
/**
* @var int
*/
private $next_index = 0;
/**
* @var array [name][type][] = registration
*/
... | true |
3c98f8adff0c21aa3b11f1dfaa43da192ed2d6cc | PHP | jbantug/heartbeat | /apirequest/youtube-api-video.php | UTF-8 | 3,357 | 2.71875 | 3 | [] | no_license | <?php
//this program accepts an array of youtubURLS as an input.
//It outputs information about the videos and channel info
//Format:JSON
ini_set('max_execution_time', 3000);
$postdata = file_get_contents("php://input");
$request = json_decode($postdata); //convert the JSON to php object
//$ids = $request->ids; //$... | true |
35a86d3fca086167a91d7dd3f80338ce9301a334 | PHP | starweb/shop-api-sdk-php | /src/Api/Generated/Model/CustomerModelItem.php | UTF-8 | 509 | 2.828125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace Starweb\Api\Generated\Model;
class CustomerModelItem
{
/**
*
*
* @var CustomerModel
*/
protected $data;
/**
*
*
* @return CustomerModel
*/
public function getData() : CustomerModel
{
return $this->data;
}
/**
*
*
... | true |
acbaa81ba8527faabfb672fda9e1b45876af7ed3 | PHP | luiscarbajo23/Padre | /model/ModelController.php | UTF-8 | 642 | 2.78125 | 3 | [] | no_license | <?php
/**
* Description of ModelController
*
* @author LuisCarbajo
*/
require_once MODEL_PATH . 'PieceList.php';
class ModelController {
private static $modelController;
public function __construct() {}
public function getInstance() {
if (is_null($this->modelControlle... | true |
f5e0f06a4e6b25800a20a07b9096e385584126e0 | PHP | theranger/brightroom | /lib/img/ExifParser.php | UTF-8 | 2,195 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | <?php
/**
* Copyright 2016 The Ranger <ranger@risk.ee>
*
* 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 appli... | true |
db756f5f972e384df5fd1862a62a70267355e138 | PHP | ajcrites/PHP.md | /src/tree/Node.php | UTF-8 | 1,236 | 3.265625 | 3 | [] | no_license | <?php
class Node implements Nodable {
private $parent;
private $children = array();
private $tag;
private $value;
public function __construct($tag, Nodable $parent) {
$this->parent = $parent;
$this->tag = $tag;
}
public function updateType($type) {
$this->type = $type;
}
... | true |
68e14321d3f7b28ecc577f191940bab804fbda54 | PHP | Edivald0/PROYECTOS-PHP | /codejobs/v4/coche.php | UTF-8 | 2,383 | 4.09375 | 4 | [] | no_license | <?php
class Coche
{
/**
* Propiedades o Atributos
*/
public $velocidad = 100;
private $serie_variable = "abc123";
private $encendido = false;
static $llantas = 4;
private $color = null;
private $marca = null;
private $modelo = null;
//CONSTRUCTOR
public function __construct($color = "Rojo", $... | true |
bac990eeee0974229817cc918d13675997ca9a5c | PHP | brunohccz/perfect-pay | /app/Traits/Models/SaleAnalytics.php | UTF-8 | 1,083 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Traits\Models;
use Illuminate\Database\Eloquent\Collection;
trait SaleAnalytics
{
public static function analytics(Collection $sales)
{
return collect()->put('sold', [
'count' => static::countByStatus($sales, static::STATUS_SOLD),
'total' => static::sumAmou... | true |
b9e40040bfe85aa4dfebd9b82c1a88eddc375069 | PHP | bdelespierre/laravel-grid | /app/Contracts/Cell/Automaton.php | UTF-8 | 118 | 2.546875 | 3 | [] | no_license | <?php
namespace App\Contracts\Cell;
use App\Models\Map;
interface Automaton
{
public function run(Map $map);
}
| true |
496712c53c790e0504cad41275b35279056e305e | PHP | codeChun/mogujie | /src/api/page.php | UTF-8 | 1,159 | 3.125 | 3 | [
"MIT"
] | permissive | <?php
/*
分页获取数据:
* pageNo=1
分页获取,pageNo指定获取第几页的数据
json_encode():把数组转成json字符串
* php5.4+ 使用JSON_UNESCAPED_UNICODE防止中文转义
$arr[];
$page_no $arr
1 0,9
2 10-19
3 20-29
... | true |
06951d1b212f9555904f57ac972e42b218f3b335 | PHP | mohammad-mazraeshahi/mapper-test | /app/Events/ProductOrderEvent.php | UTF-8 | 452 | 2.546875 | 3 | [] | no_license | <?php
namespace App\Events;
use App\Models\Order;
use App\Models\Product;
class ProductOrderEvent extends Event
{
// use Dispatchable;
public $order;
public $product;
/**
* Create a new event instance.
*
* @param Product $product
* @param Order $order
*/
public function ... | true |
3abad25f586ae6f0032f7203f902d60da4271f91 | PHP | DanPurdy/Backup-Diary | /mics/edit_microphone.php | UTF-8 | 6,212 | 2.703125 | 3 | [] | no_license | <?php
require('includes/pdoconnection.php');
function __autoload($class_name) {
include 'models/class_'.$class_name . '.php';
}
$dbh = dbConn::getConnection();
$microphone=new mic($dbh);
$session=new session($dbh);
$row=$session->getSessByID($_GET['sesID']);
$stdID = $row['stdID'];
$sesID = $row... | true |
775b43caabad56472166d5ceb070f5f4dbdeab3a | PHP | kmollee/cs50_learn | /w9/pset7/public/buy.php | UTF-8 | 3,551 | 2.8125 | 3 | [] | no_license | <?php
// configuration
require("../includes/config.php");
// if post
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
// check submit symbol and shares
if(empty($_POST["symbol"]))
{
apologize("You must provide symbol.");
}
if (empty($_POST["shares"]) ||... | true |
535624a73d9c35b4935cc04c79a019eed0220799 | PHP | oleg-melnic/proxify | /app/Entity/Course/Item/Audio.php | UTF-8 | 641 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Entity\Course\Item;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
class Audio extends ItemAbstract implements S3Interface
{
/**
* @var string
*
* @ORM\Column(name="audio", type="string", nullable=false)
*/
protected $audio;
/**
* @return string
... | true |
90e5251e3dbdc46716aaea5047bf850fabe579d5 | PHP | NAONAOx1126/clay_plugins | /clay_file/modules/Csv/DownloadEnd.php | UTF-8 | 1,404 | 2.828125 | 3 | [] | no_license | <?php
/**
* ### File.Csv.DownloadEnd
* ファイルのダウンロードを行うためのクラスです。
* PHP5.3以上での動作のみ保証しています。
* 動作自体はPHP5.2以上から動作します。
*
* @category Modules
* @package File
* @author Naohisa Minagawa <info@sweetberry.jp>
* @copyright 2010-2012 Naohisa Minagawa
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache ... | true |
5d0e39bd73c27a1c2b64aa79ce761225d069cffb | PHP | UrosKuzmanovic/fSD-Leagues-work-task | /src/Entity/Position.php | UTF-8 | 518 | 2.578125 | 3 | [] | no_license | <?php
namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
class Position
{
/**
* @Assert\Choice(callback="getPositions")
*/
private $positions;
public static function getPositions(): array
{
return [
'GK',
'LB',
'CB',
... | true |
8341d3c50305d48adb3e14550784442057225dff | PHP | matthieuriolo/cii | /commands/TranslaterController.php | UTF-8 | 7,847 | 2.734375 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace app\commands;
use Yii;
use yii\console\Exception;
use yii\console\Controller;
use yii\helpers\FileHelper;
use yii\helpers\VarDumper;
/**
* A simplified version of the MessageControler
* Only for php files and only for packages/layouts
* The output will be echoed instead saved to a file
*/
class... | true |
79159a0b25f37f0e19a2ceacafbae02f9540b0a5 | PHP | mazguhin/protected-sharing-laravel | /app/Rules/ActiveChannel.php | UTF-8 | 444 | 2.6875 | 3 | [] | no_license | <?php
namespace App\Rules;
use App\Repositories\ChannelRepository;
use Illuminate\Contracts\Validation\Rule;
class ActiveChannel implements Rule
{
public function passes($attribute, $value)
{
$channelRepository = new ChannelRepository();
$channel = $channelRepository->findActiveById($value);
... | true |
99539641cb5993d247ead964aec2e4b406c86040 | PHP | Victor19Rodrigues/issues_PHP | /sessao.php | UTF-8 | 292 | 2.859375 | 3 | [] | no_license | <?php
//Gerar sessao
session_start();
$_SESSION['teste'] = "Victor";
echo 'Meu nome é: '.$_SESSION['teste'];
//Gerar Cookie
//param = nome do cookie, informação, duração do cookie
setcookie("meuteste", "Victor", time()+3600);
echo 'Meu cookie é de: '.$_COOKIE['meuteste'];
?> | true |
6c7f2b9185967d04d2c66a9e48c055f0477b2f80 | PHP | imabeppu/Camp-Callenge | /007.PHPからのDB操作/phpdatabasekadai5.php | UTF-8 | 471 | 2.5625 | 3 | [] | no_license | <?php
try{
$pdo_object= new PDO('mysql:host=localhost;dbname=challenge_db;charset=utf8','imabe','ppu');
}
catch(PDOException $Exception){
die('接続に失敗しました:'.$Exception->getMessage());
}
$select="select * from profiles where name like '%茂%'";
$query=$pdo_object->prepare($select);
$query->execute();
$result=$query->fetch... | true |
297e3f4433fe51129aab374706f1ae1755690ede | PHP | earthperson/HelloWorld | /house-rent/Schedule.class.php | UTF-8 | 8,374 | 3.0625 | 3 | [
"MIT"
] | permissive | <?php
class Schedule {
protected $headersHeight = 20; // Высота шапки
protected $scheduleViewWidth = 600; // Ширина графика
protected $legendViewWidth = 300; // Ширина легенды
protected $scheduleLineHeight = 8; // Высота линии графика
protected $scheduleLineIndent = 12;... | true |
83c9a101391665cc10e3585143b75b83c8af930b | PHP | janus-ssp/janus | /src/Janus/ServiceRegistry/DependencyInjection/TimeProvider.php | UTF-8 | 251 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace Janus\ServiceRegistry\DependencyInjection;
use DateTime;
class TimeProvider
{
/**
* Provides current time
*
* @return DateTime
*/
public function getDateTime()
{
return new DateTime();
}
} | true |
b7ea72cc1af2acead3c0dea7456e1267ea0c19b7 | PHP | Samoht07/Multiplier-9ca4c97a | /multiplier.php | UTF-8 | 171 | 3.140625 | 3 | [] | no_license | <?php
echo "Ik ga twee getallen met elkaar vermenigvuldigen" . PHP_EOL;
$A = readline("eerste getal: ");
$B = readline("2e getal: ");
echo "Uw resultaat is: " . $A * $B;
| true |
85ce65522217dd22a71ea239530dcba5ce99dfb0 | PHP | ksidenko/smto | /protected/modules/p2/components/P2Helper.php | UTF-8 | 25,770 | 2.53125 | 3 | [] | no_license | <?php
/**
* Class File
*
* @author Tobias Munk <schmunk@usrbin.de>
* @link http://www.phundament.com/
* @copyright Copyright © 2005-2010 diemeisterei GmbH
* @license http://www.phundament.com/license/
*/
/**
* Helper class
*
* Detailed info
* <pre>
* $var = code_example();
* </pre>
* {@link DefaultC... | true |
1f9036faebf0f3196065166b06faadd8ec617e92 | PHP | bellaajhabib/symfonyYoda | /fundamontals/class_getters.php | UTF-8 | 322 | 3.21875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: habib
* Date: 10/9/2016
* Time: 8:05 PM
*/
class Car {
private $door_count=4;
function get_values(){
echo $this->door_count;
}
function set_value(){
$this->door_count=12;
}
}
$my_object=(new Car());
$my_object->set_value();
$my_object->get_values(... | true |
eb11e9975a7b723e8ad32b16680e6c3919438d6f | PHP | arrilot/bitrix-hlblock-fields-fixer | /src/Fixer.php | UTF-8 | 2,196 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace Arrilot\BitrixHLBlockFieldsFixer;
use Bitrix\Highloadblock\HighloadBlockTable;
use Bitrix\Main\Application;
class Fixer
{
/**
* @var array
*/
protected static $newFieldTypes = [
'string' => 'varchar(255)',
'string_formatted' => 'varchar(255)',
... | true |
4d4830b70e70dc516cce717bf3043d45e8406416 | PHP | php-zen/web-application | /lib/ICookies.php | UTF-8 | 700 | 2.78125 | 3 | [] | no_license | <?php
/**
* 声明 Web 应用程序的 HTTP COOKIE 组件规范。
*
* @author Snakevil Zen <zsnakevil@gmail.com>
* @copyright © 2016 SZen.in
* @license LGPL-3.0+
*/
namespace Zen\Web\Application;
use Countable;
use ArrayAccess;
/**
* Web 应用程序的 HTTP COOKIE 组件规范。
*
* @version 0.1.0
*
* @since 0.1.0
*/
interface ICookies e... | true |
236bbdb4fb06d07d355aa34e444e712f3f6948b5 | PHP | Isaac96SM/JobAgency | /app/homeCompanies/NewOffer.php | UTF-8 | 3,444 | 2.625 | 3 | [] | no_license | <?php
include('headerCompanies.html');
if (isset($_GET['Title'])) {
$title = $_GET[ 'Title'];
}
if (isset($_GET['Description'])) {
$description = $_GET['Description'];
}
if (isset($_GET['Action'])) {
if ($_GET['Action'] == 2) {
require ('../../models/mysqli_connect.php');
$action = 2;
$id = $_GET['OfferI... | true |
419c9cc7224711f5221b2bb3a962aa8c1b4e76ba | PHP | prestashopy/leaflet_examples | /src/GeoJson.php | UTF-8 | 3,808 | 2.9375 | 3 | [] | no_license | <?php
namespace src;
/**
* Class GeoJson
* @package src
*/
class GeoJson{
const COORDINATE_PRECISION = 5;
/**
* @param $gpx
* @param bool $reduceCoordinate
* @return array
*/
public function convertGpxToGeoJson($gpx, $reduceCoordinate = false, $removeTime = false, $removeElevation... | true |
7dd33255001fa98edcd86e548c1583e9c2362321 | PHP | shivaneeshinde/stockmarketphp | /New folder/live.php | UTF-8 | 1,139 | 2.828125 | 3 | [] | no_license | <?php /* Turn off notices for empty string values */
function stocklink($url)
{
error_reporting(0);
/* Get data from google */
$data = file_get_contents($url);
/* Strip first and last characters */
$data = substr($data,7,strlen($data)-7-4);
/* Split data into name:value records */
$records = explode('"', $data);
... | true |
46728f198486dd7dc1668fdc2c79dbcc71ba735c | PHP | xcschina/niuniu | /core/console/bo/game_template_admin.php | UTF-8 | 2,719 | 2.5625 | 3 | [] | no_license | <?php
COMMON('baseCore','uploadHelper');
DAO('game_template_dao','common_dao');
class game_template_admin extends baseCore{
public $DAO;
public $COMMON;
public function __construct(){
parent::__construct();
$this->DAO = new game_template_dao();
$this->common = new common_dao();
... | true |
59c1cf10b86b4d3610ded1848c33ef085c8c4d78 | PHP | Yov00/work--home | /app/Http/Controllers/EmployeeController.php | UTF-8 | 1,313 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Employee;
use App\Company;
class EmployeeController extends Controller
{
public function create()
{
$title ="Create Employee";
return view('pages.create_Employee',compact('title'));
}
public function store(Compa... | true |