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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a7146af73ff4f87903d8304eab3418b114df6aad | PHP | KuhnSteven/SSL | /SSL-1907/myframework/models/model.php | UTF-8 | 1,677 | 3.15625 | 3 | [] | no_license | <?php
class model{
public function __construct($parent){
$this->parent = $parent;
}
// CREATE
// name is passed through $params via addForm
// register new user logic
// INSERT INTO `users`.`accounts` (`id` , `email` , `password` , `bio`) VALUES ('1', 'mike@aol.com', 'password', ... | true |
e2d75486d91ecd4edc20f03b86dcac4d39ec3110 | PHP | helloMOTO0221/test1 | /employee.php | UTF-8 | 1,454 | 2.6875 | 3 | [] | no_license | <?php
session_start();
require("dbconnect.php");
$sql = "select * from todo where status=0 ORDER BY case when importance like '緊急' then 0 else 1 end,importance desc";
$result=mysqli_query($conn,$sql) or die("DB Error: Cannot retrieve message.");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://... | true |
b62e806be450a0c1cc356dedd9f18e9725336594 | PHP | hengwoon/reamaze-api-client-php | /tests/MessageTest.php | UTF-8 | 1,590 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace Reamaze\Tests;
use Reamaze\API\Message;
use Reamaze\API\Conversation;
use Reamaze\API\Exceptions\Api as ApiException;
class MessageTest extends TestCase {
public function testGetPath() {
$this->assertEquals('/v1/messages', Message::path());
}
public function testCreateRequiresCon... | true |
b0e10af8debfda5fc66238d9f3b4a4e5aa9d6bd6 | PHP | paysera/lib-delivery-api-merchant-client | /src/Entity/ShipmentCreate.php | UTF-8 | 1,444 | 2.53125 | 3 | [] | no_license | <?php
namespace Paysera\DeliveryApi\MerchantClient\Entity;
use Paysera\Component\RestClientCommon\Entity\Entity;
class ShipmentCreate extends Entity
{
public function __construct(array $data = [])
{
parent::__construct($data);
}
/**
* @return integer
*/
public function getWeigh... | true |
ca782ef811aa36c147c17c5365bbdfc359c15281 | PHP | sensus-media/SensusInxmailConnect6 | /custom/plugins/SensusInxmailConnect6/src/Lib/inxmail_api/Api/Rendering/ParseException.php | UTF-8 | 1,725 | 2.875 | 3 | [] | no_license | <?php
/**
* @package Inxmail
* @subpackage Rendering
*/
/**
* An <i>Inx_Api_Rendering_ParseException</i> is thrown when the parsing of a mailing fails. The reason for such a
* failure usually is a syntax error. For a deeper insight on the error, consult the
* <i>Inx_Api_Rendering_RenderError</i>s asso... | true |
11b2258d1f894c5862dc4a1a3abdc83cc0221aa6 | PHP | vlotysh/lightflow | /core/Event/EventDispatcher.php | UTF-8 | 798 | 3.09375 | 3 | [] | no_license | <?php
namespace Core\Event;
use Core\Listeners\EventListenerInterface;
/**
* Class EventListener
*
* @package App\Core
*/
class EventDispatcher
{
/**
* @var array
*/
private $listeners = [];
/**
* @param string $event
* @param array $args
*/
public function publish(str... | true |
2561fb2b0c485e1aa4b0a36c72de31699a2a445a | PHP | wassim213/Symfony | /demos/src/Controller/NautiqueController.php | UTF-8 | 4,560 | 2.59375 | 3 | [] | no_license | <?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use App\Entity\Base;
use Symfony\Component\HttpFoundation\Request;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\Form\Extension\Core\Type\TextType;... | true |
ca044a5f333ec198421616e8cc5b89524670348c | PHP | laravolt/laravolt | /packages/suitable/src/Columns/DateTime.php | UTF-8 | 508 | 2.578125 | 3 | [] | no_license | <?php
namespace Laravolt\Suitable\Columns;
use Carbon\Carbon;
class DateTime extends Date implements ColumnInterface
{
protected $format = 'LLL';
public function cell($cell, $collection, $loop)
{
try {
return Carbon::createFromFormat('Y-m-d H:i:s', $cell->{$this->field})
... | true |
6736b331ee0726f1fabed3f071955f5e66e5c375 | PHP | BerilBBJ/scraperwiki-scraper-vault | /Users/H/HoshiNite/m_1.php | UTF-8 | 3,044 | 2.765625 | 3 | [] | no_license | <?php
$curl = curl_init("http://www.4dresult.com.my/");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$page = curl_exec($curl);
if(curl_errno($curl)) throw new Exception (curl_error($curl));
curl_close($curl);
$xpathExpr = '/html/body/form/table/tbody/tr[3]/td[1]/table/tr/td[2]/table[2]';
$dom = new DOMDocumen... | true |
59db4e1923235b2f6a567c353ee9465bba5b6a40 | PHP | TrevorMW/wp-lrsgen | /lib/classes/class-action_name.php | UTF-8 | 418 | 2.640625 | 3 | [] | no_license | <?php
class Action_Name
{
public $type;
public function __construct( $post )
{
if( is_object( $post ) )
{
if( $post->post_type == 'page' )
{
$type = str_replace( '-', '_', $post->post_name ).'_';
}
else
{
$type = str_replace( '-', '_', $post->post_type ).'_'... | true |
a9427f94571506d2cf93381f6298658f6041101f | PHP | daggerhart/query-wrangler | /includes/fields/meta_value.php | UTF-8 | 6,337 | 2.609375 | 3 | [] | no_license | <?php
// add default fields to the hook filter
add_filter( 'qw_fields', 'qw_field_meta_value' );
/*
* Add field to qw_fields
*/
function qw_field_meta_value( $fields ) {
$show_silent_meta = QW_Settings::get_instance()->get( 'show_silent_meta', FALSE );
// Create a unique cache name
$_cache_name = md5(json_encode... | true |
4e3c51f12c146e82c160299999f38f3a6c0e703e | PHP | 401256352/yoshop_pros | /source/application/common/model/WxappPrepayId.php | UTF-8 | 1,391 | 2.5625 | 3 | [] | no_license | <?php
namespace app\common\model;
use app\common\enum\OrderType as OrderTypeEnum;
/**
* 小程序prepay_id模型
* Class WxappPrepayId
* @package app\common\model
*/
class WxappPrepayId extends BaseModel
{
protected $name = 'wxapp_prepay_id';
/**
* prepay_id 详情
* @param int $orderId
* @param int $o... | true |
3ed17b34180b1780640a0cfb7a2e426facf02cfa | PHP | yemasky/hotel | /libs/XML.class.php | UTF-8 | 3,563 | 3.03125 | 3 | [] | no_license | <?php
/**
* class.RunXmlAPI.php
*-------------------------
*
*
* PHP versions 5
*
* @author cooc <yemasky@msn.com>
*/
/**
* about runtime xml file load and store
*/
class XML {
public $localEncoding = NULL;
/**
* 装截运行时XML文件
* @param Int
* @return Array
*/
public function loadToArray($pathfil... | true |
0881787e584d4d25b9afd4c0bfbd462ad888d5bc | PHP | raikeeen/PythonLabs | /laba4.php | UTF-8 | 809 | 2.671875 | 3 | [] | no_license |
<?php
/*session_start(); //начало сессии
if (!$_SESSION['start']) {
$_SESSION['k']=10;
*/
//session_start();
$I=$_POST['p']*$_POST['r']*$_POST['t'];
?>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" type="text/css" href="style/123.css" />
</head>
<body>
<h... | true |
16229f629e0a4c117c76efad0df74391978960d7 | PHP | githubkranthi/smartsmscustomer | /frontend/modules/user/models/Contacts.php | UTF-8 | 2,388 | 2.703125 | 3 | [] | permissive | <?php
namespace frontend\modules\home\models;
use yii\db\ActiveRecord;
use Yii;
use yii\db\Query;
class Contacts extends ActiveRecord
{
public static function tableName()
{
return 'contacts';
}
public static function getDb()
{
return Yii::$app->db;
}
public static functi... | true |
061d4e1ac454ad78f976ffd226a77edd865ad2e0 | PHP | ivacuum/generic | /src/Utilities/ModelCacheHelper.php | UTF-8 | 3,090 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php namespace Ivacuum\Generic\Utilities;
use Carbon\CarbonInterval;
use Illuminate\Database\Eloquent\ModelNotFoundException;
/**
* Вспомогательный класс для упрощения работы с кэшированными данными моделей
*
* До использования необходимо объявить в экземляре класса:
* - const CACHED_BY_ID_KEY
* - const CACHED_... | true |
851ef9cd54ad666be856abcd17917fb2cd5adb96 | PHP | Turbotailz/victory-road | /app/Pokemon.php | UTF-8 | 738 | 2.59375 | 3 | [] | no_license | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Pokemon extends Model
{
protected $with = ['types'];
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = false;
// Get the type(s) of the Pokemon
public function types() ... | true |
69b2f58a6c8a2e10ddac7ea899ded31e6c4a77fc | PHP | ajpadilla/tienda-virtual | /lib/view.php | UTF-8 | 370 | 2.75 | 3 | [] | no_license | <?php
function error_msg($error,$msg)
{
if(isset($error) && $error)
{
return $msg;
}
return "";
}
function logged_in()
{
if (isset($_SESSION["user"]))
{
return true;
}
else
{
return false;
}
}
function current_user($field)
{
if($_SESSION["user"])
{
return $_SESSION["user"... | true |
cbb928b5116a41cdb77f07467429ac3a61b54141 | PHP | wonderpush/wonderpush-php-lib | /lib/Params/AllInstallationsParams.php | UTF-8 | 1,005 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace WonderPush\Params;
if (count(get_included_files()) === 1) { http_response_code(403); exit(); } // Prevent direct access
class AllInstallationsParams extends CollectionParams {
/** @var string[] */
private $segmentIds;
/** @var string */
private $reachability;
/**
* @return string[]
... | true |
b6e3892eb756a06ddf98684e083c536ec8c06eb2 | PHP | tylersticka/niftycolor | /demo.php | UTF-8 | 1,637 | 2.65625 | 3 | [] | no_license | <?php include 'niftycolor.php';
?><!doctype html>
<html lang="en">
<head>
<title>NiftyColor Demo</title>
<style>
html {
background: #f9f9f9;
color: #666;
font-family: sans-serif;
font-size: 87.5%;
line-height: 1.4em;
}
body {
margin: 2em;
}
h1 {
margin: 1em 0 0.5em;
... | true |
1d465273158f866402a4bbfa89d49f1be5d606e6 | PHP | bergelmir/mutateme | /library/Mutateme/Mutation/MutationAbstract.php | UTF-8 | 3,197 | 3.15625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/**
* Mutateme
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://github.com/padraic/mutateme/blob/rewrite/LICENSE
* If you did not receive a copy of the li... | true |
62d889fbcf5641415f310f813c2830315ba4d680 | PHP | piotrkabacinski/renderView | /renderView.static.php | UTF-8 | 2,624 | 3.25 | 3 | [
"MIT"
] | permissive | <?php
/**
* @author Piotr Kabacinski
*/
namespace view;
class RenderView {
static $template;
static $data = array();
static function render($template = "" , $data = array()) {
$template = file_get_contents($template);
self::$template = $template;
self::$data = $data;
self::renderLoops();
self::ren... | true |
e817568d94081814642e62656069248b6d24b425 | PHP | bergie/midgardmvc_core | /tests/helpers/headTest.php | UTF-8 | 4,271 | 2.53125 | 3 | [] | no_license | <?php
/**
* @package midgardmvc_core
* @author The Midgard Project, http://www.midgard-project.org
* @copyright The Midgard Project, http://www.midgard-project.org
* @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
*/
/**
* Test to see if the head helper is working
*
* @package ... | true |
0dc0779eb4b8fead302f95c877809de91ddbc791 | PHP | marmelab/battleship-symfony | /app/src/Entity/Player.php | UTF-8 | 1,634 | 2.765625 | 3 | [] | no_license | <?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use JsonSerializable;
/**
* @ORM\Entity(repositoryClass=PlayerRepository::class)
*/
class Player implements JsonSerializable
{
/**
* @ORM\Id
* @ORM... | true |
401dc7eeafe48759a1b95375fcef025b5728223f | PHP | AndreyMajoroff/arrays_loops_tasks | /6.php | UTF-8 | 674 | 3.734375 | 4 | [] | no_license | <?php
/* 6. Дан массив $arr. С помощью цикла foreach запишите английские названия в массив $en, а русские — в массив
$ru. $arr = array('green'=>'зеленый', 'red'=>'красный','blue'=>'голубой'); $en = array('green', 'red','blue');
$ru = array('зеленый', 'красный', 'голубой');
*/
$arr = array('green'=>'зеленый', 'red'... | true |
75e394be481cff18e43e27ef1d13eafa84444b20 | PHP | rexcool220/MommysSecret | /MemberNew.php | UTF-8 | 5,128 | 2.921875 | 3 | [] | no_license | <?php
require_once __DIR__ . '/vendor/autoload.php';
require_once 'ConnectMySQL.php';
header("Content-Type:text/html; charset=utf-8");
if(!session_id()) {
session_start();
}
/*
NEW.PHP
Allows user to create a new entry in the database
*/
// creates the new record form
// since this form is used multiple time... | true |
86665bf23fb2e3b4fccaa1a80061af1d6257ff9c | PHP | mouad1991/weMovies | /src/Entity/Video.php | UTF-8 | 2,215 | 3.078125 | 3 | [] | no_license | <?php
namespace App\Entity;
class Video
{
/**
* @var string
*/
private $name;
/**
* @var string
*/
private $key;
/**
* @var string
*/
private $site;
/**
* @var string
*/
private $type;
/**
* @var bool
*/
private $official;
... | true |
e759e69191c09923c15eb88b09dcbdebf972cbff | PHP | OrLove101/DevClub | /PHP/algorithms/arrayShiftLeft.php | UTF-8 | 122 | 2.75 | 3 | [] | no_license | <?php
function arrayShiftLeft(&$array) {
$shifted = array_shift($array);
$array[] = $shifted;
}
?> | true |
e65373f3ef2b791b0f74c916a4238d988effd3c9 | PHP | mikailll/Garage-Opdracht | /klant/gar-search-klant2.php | UTF-8 | 1,854 | 2.75 | 3 | [] | no_license | <!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="CSS/style.css">
<... | true |
5414d320e1b81a12e1e1b227ff7fbf7e675e63cf | PHP | yann-eugone/presta-sitemap-test-project | /src/DataFixtures/Loader.php | UTF-8 | 2,039 | 2.71875 | 3 | [] | no_license | <?php
namespace App\DataFixtures;
use App\Entity\BlogPost;
use App\Entity\Page;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Persistence\ObjectManager;
use Faker\Factory;
/**
* @author Yann Eugoné <yeugone@prestaconcept.net>
*/
class Loader extends Fixture
{
/**
* @inheritdoc
*/
publi... | true |
a20e4e57aa7b1ac73b6433f432ce2ab15a9485e6 | PHP | MagentaTA/CRM | /vendor/drteam/uon/tests/MiscTest.php | UTF-8 | 1,517 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
use PHPUnit\Framework\TestCase;
class MiscTest extends TestCase
{
private $_misc;
private $_avia;
private $_call;
private $_mail;
public function __construct($name = null, array $data = [], $dataName = '')
{
parent::__construct($name, $data, $dataName);
include __DIR__ . ... | true |
d6b4aece54a54b83815af856aee1259419828715 | PHP | cgatherer/brtsy | /web/modules/contrib/geofield/src/WktGeneratorInterface.php | UTF-8 | 2,914 | 2.828125 | 3 | [
"MIT",
"GPL-2.0-only"
] | permissive | <?php
namespace Drupal\geofield;
/**
* Defines an interface for WktGenerator.
*/
interface WktGeneratorInterface {
/**
* Helper to generate a random WKT string.
*
* Try to keeps values sane, no shape is more than 100km across.
*
* @return string
* The random WKT value.
*/
public function... | true |
76f7a2017fa4bf13a84ff79e032121b83b421400 | PHP | vuchkov/quantum-php-project | /modules/Web/Controllers/PostController.php | UTF-8 | 2,131 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace Modules\Web\Controllers;
use Quantum\Factory\ServiceFactory;
use Quantum\Factory\ViewFactory;
use Quantum\Mvc\Qt_Controller;
use Quantum\Hooks\HookManager;
use Base\Services\PostService;
use Quantum\Http\Request;
class PostController extends Qt_Controller
{
public $view;
public $postService;... | true |
0ab66bba1b431a0c2f97f248be094d3e71514071 | PHP | rominaVilches/MantenedorForo | /admin.php | UTF-8 | 2,309 | 2.53125 | 3 | [] | no_license | <?php
require('conexion.php');
session_start();
if(!isset($_SESSION['nombre']) || $_SESSION['tipo'] != 'A'){
header('location:loginForo.php?m=Su sessión ha caducado');
}
$nombreUsuario = $_SESSION['nombre'].' '. $_SESSION['apellido'];
$user = $_SESSION['usuario'];
if(isset($_GET['n'])){
$sql = "DELETE FROM for... | true |
f847ce0256b24f2dbe1c27e449049ca3e744ae7a | PHP | cmj2010/simple-web-app | /sample2.php | UTF-8 | 1,670 | 2.765625 | 3 | [
"MIT"
] | permissive | <center>
<table class='table table-bordered'>
<tr><th>Meta-Data</th><th>Value</th></tr>
<?php
#The URL root is the AWS meta data service URL where metadata
# requests regarding the running instance can be made
$urlRoot="http://169.254.169.254/latest/meta-data/";
$instanceId = file_get_contents($urlRoot . 'insta... | true |
2bfc8ca1e20613f577ef5ee014817434e4c5c9a1 | PHP | JimYangZhao/Equipmee-LiamProject | /app/Http/Livewire/AllEquipment.php | UTF-8 | 949 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Livewire;
use App\Equipment;
use Livewire\Component;
use Livewire\WithPagination;
class AllEquipment extends Component
{
use WithPagination;
protected $paginationTheme = 'bootstrap';
public $searchTerm = '', $showCount, $idNumber = 0, $equipId, $isDeleted = false;
public... | true |
7d3bc04e6218ae418f8cedad46f22e2ef38ee21a | PHP | Bujeas/rim | /database/migrations/2017_05_31_062014_create_units_table.php | UTF-8 | 1,267 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUnitsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('units', function(... | true |
f66ad09571cfebb47b1bdc44e9ed690cdd90c5fe | PHP | randonner65/kharkovrele28.local | /draw/QuadrangleFilled.php | UTF-8 | 637 | 2.859375 | 3 | [] | no_license | <?php
//КЛАСС ВЫЧЕРЧИВАНИЯ ЗАПОЛНЕННОГО ЧЕТЫРЕХУГОЛЬНИКА
class QuadrangleFilled extends Quadrangle {
public function __construct($PREL, $PRGR = array()){
parent::__construct($PREL, $PRGR);
}
//Вывод четырехугольника в браузер
public function out(){
for($j=0; $j<4; $j++){
$this->QUADRANGLE[2*$j] = $this->X($this-... | true |
931309cc7d900934b7bcaae20ddb228c27134a95 | PHP | md-shefatul-islam/learning-web-technologies-spring-2020-2021-sec-h | /MID_LAB_TASK_PHP_04/Task3.php | UTF-8 | 112 | 3.390625 | 3 | [] | no_license | <?php
$num=3;
if($num % 2 == 0){
echo("Given number is even");
}
else{
echo "Given number is odd";
}
?> | true |
4017b19163650229d9bfa19a3c29c2ed54549e32 | PHP | DAS27/shop | /app/Http/Requests/OrderRequest.php | UTF-8 | 1,852 | 2.6875 | 3 | [] | no_license | <?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class OrderRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the ... | true |
ea15655aca8808a04e16711e508af1fc8352e0b2 | PHP | vimi30/WDM-Centro-Agusto | /app/Http/Controllers/EventController.php | UTF-8 | 3,310 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Event;
use DB;
class EventController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function __construct()
{
$this->middleware('auth');
... | true |
b02b702b73efc0d26f5153ca30ae6a48843b6e1c | PHP | dimitrizarkua/SaaS-Backend-Laravel | /app/Http/Requests/RBAC/AttachRoleRequest.php | UTF-8 | 1,023 | 2.671875 | 3 | [] | no_license | <?php
namespace App\Http\Requests\RBAC;
use App\Http\Requests\ApiRequest;
/**
* Class AttachRoleRequest
*
* @OA\Schema(
* type="object",
* required={"roles"},
* @OA\Property(
* property="roles",
* type="array",
* @OA\Items(
* type="integer",
* ... | true |
101e1ff72e838cf838583253d056fcba428a93e2 | PHP | josea2017/P2_FRONT_TUBEKIDS | /models/Register.php | UTF-8 | 6,652 | 2.875 | 3 | [] | no_license | <?php
namespace Models{
class Register
{
function __construct(){
}
public function verify_all_data($name, $last_name, $email, $phone_number, $country_code, $birthday, $password, $confirm_password)
{
if($name != '' && $last_name != '' && $email != '' && $phone_number != '' && $country_code != ... | true |
ebb120a871cc7c9b62dcabf1d9ce45f1292c6507 | PHP | CathalAKABango/webFrame-Project | /projectFirstAttempt/tests/StudentTest.php | UTF-8 | 3,875 | 2.78125 | 3 | [] | no_license | <?php
namespace ItbTest;
use Itb\Model\Student;
class StudentTest extends \PHPUnit_Framework_TestCase
{
public function testCanGetId()
{
// Arrange
$st = new Student();
$expectedResult = 0;
// Act
$result = $st->getId();
// Assert
$this->assertEquals($... | true |
2031726e75ed199ba4bb66f724d738ab6c4d49de | PHP | Nic0lasJ/Projet | /Projet.stage/Test.bdd.php | UTF-8 | 671 | 2.5625 | 3 | [] | no_license | <?php
$link = mysql_connect("localhost", "nicolas", "nicolas");
mysql_select_db("givebox", $link) or die(mysql_error());
$query = "SELECT * FROM `users`";
$result = mysql_query($query, $link) or die($query . " - " . mysql_error());
$nbResults = mysql_num_rows($result);
echo $nbResults;
echo "<br /><br />";
... | true |
a256532e2fbb87caedefa030775a4a76914806b8 | PHP | oshchyp/test-task | /src/Service/EmailSender/SendToUserMessageInterface.php | UTF-8 | 229 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php declare(strict_types=1);
namespace App\Service\EmailSender;
interface SendToUserMessageInterface
{
public function to(): string;
public function getSubject(): string;
public function getMessage(): string;
}
| true |
d25d3e0cf46c8871f254c3374cd7e16358226b07 | PHP | celyes/php8-design-patterns | /src/Patterns/Structural/Proxy/FileCacheReader.php | UTF-8 | 890 | 3.1875 | 3 | [
"MIT"
] | permissive | <?php
namespace Patterns\Structural\Proxy;
use Patterns\Structural\Proxy\Interfaces\Reader;
class FileCacheReader implements Reader
{
/**
* Cache the content...
*
* @var array<string> $cache
*/
private array $cache = [];
/**
* __construct assign values
*
* @param Rea... | true |
17e9663a01c6f43feea880265b9f9def5de3aa3f | PHP | TheFox/tumblr-parser | /src/TheFox/Tumblr/Element/Post/PhotosetBlockElement.php | UTF-8 | 1,075 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace TheFox\Tumblr\Element\Post;
use TheFox\Tumblr\Element\VariableElement;
use TheFox\Tumblr\Element\CaptionBlockElement;
use TheFox\Tumblr\Post\PhotosetPost;
class PhotosetBlockElement extends PostBlockElement
{
public function setElementsValues()
{
/** @var PhotosetPost|null $post */
... | true |
f1b2fb9146c832611f79d649429aa988b170a0ab | PHP | stratus-meridian/apigee-kickstart-drupal8-drops | /vendor/consolidation/annotated-command/src/Parser/Internal/TagFactory.php | UTF-8 | 1,448 | 2.984375 | 3 | [
"MIT"
] | permissive | <?php
namespace Consolidation\AnnotatedCommand\Parser\Internal;
/**
* Hold some state. Collect tags.
*/
class TagFactory
{
/** @var DocblockTag|null Current tag */
protected $current;
/** @var DocblockTag[] All tag */
protected $tags;
/**
* DocblockTag constructor
*/
public functi... | true |
17b52733f7085bfaf250502fb673026abf580b03 | PHP | jormin/message-server | /src/app/Models/UserLoginLogModel.php | UTF-8 | 1,286 | 2.71875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: Jormin
* Date: 2018/10/16
* Time: 下午1:55
*/
namespace app\Models;
class UserLoginLogModel extends BaseModel
{
public $table = 'xieqiaomin_user_login_log';
/**
* 添加登录日志
* @param $transactionID
* @param $userID
* @param $loginTime
* @para... | true |
ac69255fe638045d01be56c43c32341218a29ba4 | PHP | nsavicks/AuctionHouse | /Implementation/application/controllers/Dashboard.php | UTF-8 | 4,019 | 2.6875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
/**
*@author Filip, Nebojsa
* Controller class for Dashboard page
*/
class Dashboard extends CI_Controller{
/**
* Default constructor for Dashboard controller
* @return
*/
public function __construct(){
parent::__construct();
$this->load->model("Auction");
}
/**
* Helper fun... | true |
97b98da6162a39e25f24c9617f66b116f7d6fa5e | PHP | jcrowson/wpjobboard | /application/libraries/Upgrade/Manager.php | UTF-8 | 9,602 | 2.515625 | 3 | [] | no_license | <?php
class Wpjb_Upgrade_Manager
{
const MULTI = true;
/**
* Updates server URL
*
* @var string
*/
public static $url = "https://wpjobboard.net/api";
/**
* Plugin slug
*
* @deprecated 5.2.0
* @var string
*/
const SLUG = "wpjobboard";
... | true |
286716e89938a541f488ec2d330c2da8ced9e34c | PHP | CapucineWebtech/php_cour | /src/fonctionsUtiles.php | UTF-8 | 462 | 2.84375 | 3 | [] | no_license | <?php
function connectBdd(array $infoBdd): ?PDO
{
try {
var_dump($infoBdd);
$dsn = $infoBdd['type'] . ':host=' . $infoBdd['host'] . ';dbname=' . $infoBdd['dbname'];
var_dump($dsn);
$dbh = new PDO($dsn, $infoBdd['user'], $infoBdd['pass']);
} catch (... | true |
4382c7ce23a8cb22bb86b8a9ae866441ddd0b88e | PHP | jdreesen/phln | /tests/type/IsTest.php | UTF-8 | 1,208 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
use const phln\type\is;
class IsTest extends \Phln\Build\PhpUnit\TestCase
{
public function getTestedFn(): string
{
return is;
}
/**
* @param $type
* @param $value
* @test
* @dataProvider isDataProvider
*/
public function it_tests_given_type($type, $value)
... | true |
bbc7370f1e638ff11214fc221760c9327197934f | PHP | jzxyouok/wx_hrbust_sign | /core.class.php | UTF-8 | 2,265 | 2.671875 | 3 | [] | no_license | <?php
class core{
private $user="";
private $_service;
public function __construct() {
require_once ('service.class.php');
$this->_service = new service();
// $res = $this->_service->get_log('s');
// echo $res['gmt_register'];
// $this->_service->update_user('李四','0');
// $this->_service->update_lo... | true |
8a0ecbb89a50f4a0e509d19556484cf36d17e8b7 | PHP | mrkalmdn/psgc-api | /app/Eloquent/SubMunicipality.php | UTF-8 | 842 | 2.53125 | 3 | [] | no_license | <?php
namespace App\Eloquent;
use Illuminate\Database\Eloquent\Model;
class SubMunicipality extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['code', 'city_id', 'name', 'population'];
/**
* The attributes that should be hidde... | true |
96f9dbf500e341645a191fe2c61ac3387f08dc0e | PHP | BThiebaut/WorkShopSymfonyApi | /src/WorkShopBundle/Entity/HumainDefinition.php | UTF-8 | 2,609 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace WorkShopBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* HumainDefinition
*
* @ORM\Table(name="humain_definition")
* @ORM\Entity(repositoryClass="WorkShopBundle\Repository\HumainDefinitionRepository")
*/
class HumainDefinition
{
/**
* @var int
*
* @ORM\Column(name="id", t... | true |
0fcaa9ec38333df29a5dedeb118b2bce8f222df6 | PHP | realandraja/kebabstagram | /app/Controllers/HomeController.php | UTF-8 | 1,097 | 2.578125 | 3 | [] | no_license | <?php
namespace App\Controllers;
use App\Controllers\Controller;
use App\Models\{Photos, Tags};
use Slim\Views\Twig as View;
use Illuminate\Pagination\Paginator;
class HomeController extends Controller
{
/** Home page controller */
public function index($request,$response,$args)
{
// Getting bas... | true |
34288139ca0e0fa2a1acfd351b05c399c1f1bf91 | PHP | cuitcode/paystack | /src/Concerns/ManagesTransaction.php | UTF-8 | 2,459 | 2.515625 | 3 | [] | no_license | <?php
namespace Cuitcode\Paystack\Concerns;
use Carbon\Carbon;
use Cuitcode\Paystack\Paystack;
use Cuitcode\Paystack\Exceptions\CustomerAlreadyCreated;
use Cuitcode\Paystack\Exceptions\InvalidArgument;
use Cuitcode\Paystack\Exceptions\InvalidCustomer;
use Cuitcode\Paystack\Models\Transaction;
use Cuitcode\Paystack\Tr... | true |
19d63d91986a107f7a6f93850674ecead78ead78 | PHP | oxosolutions/adminpie | /app/Model/Admin/FieldMeta.php | UTF-8 | 464 | 2.515625 | 3 | [] | no_license | <?php
namespace App\Model\Admin;
use Illuminate\Database\Eloquent\Model;
class FieldMeta extends Model
{
protected $table = 'global_form_field_meta';
protected $fillable = ['form_id','section_id','field_id','key','value'];
public static function getMetaByKey($metaArray, $metaKey){
$metaData = $metaArray->wh... | true |
474528fcf77bef0f735dc4ab92b62f572c0b91b7 | PHP | wikimedia/mediawiki-extensions-CategoryTests | /ExtCategoryTests.php | UTF-8 | 2,972 | 2.859375 | 3 | [] | no_license | <?php
/**
* CategoryTests extension by Ryan Schmidt
* Functions for category testing
* Check https://www.mediawiki.org/wiki/Extension:CategoryTests for more info on what everything does
*/
class ExtCategoryTests {
function ifcategory( &$parser, $category = '', $then = '', $else = '', $pagename = '' ) {
if ( $cat... | true |
7e17dc6671d3aaebe8407cff0a7dece1dae3b410 | PHP | miguelnicolas/h_vm_test | /app/src/Application/Commands/CommandActionService.php | UTF-8 | 1,413 | 2.796875 | 3 | [] | no_license | <?php
namespace App\Application\Commands;
use App\Application\Commands\CommandInterface;
use App\Application\Commands\CommandAction;
use App\Application\Commands\CommandInput;
class CommandActionService extends CommandAction implements CommandInterface
{
public function __construct(CommandInput $commandInput)
... | true |
ba2145713f0ea7ea870565ce4db79c29ca5982c7 | PHP | andmarss/mgc-task | /App/System/Session.php | UTF-8 | 3,317 | 3.140625 | 3 | [] | no_license | <?php
namespace App\System;
class Session
{
/**
* @var Session $instance
*/
protected static $instance;
/**
* Добавляет элемент в сессию
*
* @param string|null $key
* @param $value
* @return mixed
*/
public function put(?string $key, $value)
{
if($ke... | true |
a83647bb3d3ae8488f58871cab167c38622cbae2 | PHP | wriver4/activerecord | /Activerecord/SQLBuilder.php | UTF-8 | 12,368 | 3.046875 | 3 | [
"MIT"
] | permissive | <?php
/**
* @package Activerecord
*/
namespace Activerecord;
use Activerecord\Exceptions\ExceptionActiverecord;
use Activerecord\Connection;
use Activerecord\Expressions;
use Activerecord\SQLBuilder;
use Activerecord\Utils;
/**
* Helper class for building sql statements progmatically.
*
* @package Activerecord
... | true |
b062a2092b94becf111a9e63c54a5b4806dd97a4 | PHP | 944491509/daiwei-project | /app/Models/District/AreaStand.php | UTF-8 | 2,814 | 2.796875 | 3 | [] | no_license | <?php
namespace App\Models\District;
use App\Models\ChinaArea;
use Illuminate\Database\Eloquent\Model;
class AreaStand extends Model
{
/**
* @var array
*/
protected $fillable = [
'id', 'province_id', 'city_id', 'district_id', 'name', 'operator', 'explain',
'remark', 'type', 'level... | true |
790177a94c646fa7030d0510440c19b67fcc6dff | PHP | AxBeaton/Asg03 | /project2/removeCookies.php | UTF-8 | 1,221 | 2.75 | 3 | [] | no_license | <?php
if (isset($_GET['postId'])) {
$postArray = unserialize($_COOKIE['post']);
unset($postArray[$_GET['postId']]);
// issue: the indexs do not update after unset.
$postArray = array_values($postArray);
if (empty($postArray)) {
unset($_COOKIE['post']);
setcookie("post", "", time() ... | true |
113bfbdf8745896a08375244d34def7d405f3c67 | PHP | biubiubiuHah/jokesystem | /login.html.php | UTF-8 | 1,058 | 2.53125 | 3 | [] | no_license | <!-- 登陆表单-->
<?php include_once $_SERVER['DOCUMENT_ROOT'].'/admin/includes/html.inc.php'; ?>
<!DOCTYPE html>
<html lang = "en">
<head>
<meta charset = "utf-8">
<title>Log In</title>
</head>
<body>
<h1>Log In</h1>
<p>Please log in to view page that you requested.</p>
<!--如果检测到全局变量loginError 即输出错误信息... | true |
5679be7dc9fe954d354cb53bd974fdad9fe7d71f | PHP | JanMoriaux/WDA | /Werkstuk/models/viewmodels/UserRegistrationViewModel.php | UTF-8 | 1,311 | 2.9375 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: janmo
* Date: 21/04/2017
* Time: 12:50
*/
require_once ROOT . '/models/entities/User.php';
class UserRegistrationViewModel extends User
{
/**
* @var string
*/
protected $repeatPassword;
/**
* UserRegistrationViewModel constructor.
* @para... | true |
462970b30277af2d9428282a65b80e2c206a0ec8 | PHP | nicomegan/Website | /Dao.php | UTF-8 | 6,360 | 2.84375 | 3 | [] | no_license | <?php
//require_once 'KLogger.php';
class Dao {
private $host = "us-cdbr-iron-east-05.cleardb.net"; //"localhost";
private $db = "heroku_91a63d0f5d5bb3f"; //"MeganDatabase";
private $user = "bb9ed37c91e92c"; //"root";
private $pass = "f6fe1a54"; //"";
// protected $logger;
private function g... | true |
1dc9232547ac7947f58420440751753335df836f | PHP | tchoulom/breengrow-backend | /src/Infrastructure/Symfony/Doctrine/Entity/OrderLine.php | UTF-8 | 2,121 | 2.59375 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace App\Infrastructure\Symfony\Doctrine\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Class OrderLine
* @ORM\Entity()
* @package App\Infrastructure\Symfony\Doctrine\Entity
*/
class OrderLine
{
/**
* @var int
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM... | true |
acd74df0b55be9ae89019ce59255b496fbb891ea | PHP | ducthobkhn/azbooking | /model/mangxahoi.php | UTF-8 | 1,234 | 2.625 | 3 | [] | no_license | <?php
class mangxahoi
{
public $Id,$Face,$Feed,$Twitter,$Google,$Youtube;
public function mangxahoi($data=array())
{
$this->Id=isset($data['Id'])?$data['Id']:'';
$this->Face=isset($data['Face'])?$data['Face']:'';
$this->Feed=isset($data['Feed'])?$data['Feed']:'';
$this->Twitter=isset($data['... | true |
996b2b47c86a0ee9b25cd00099169e49d7f7d38c | PHP | showdc/Helpdesk | /mantenace/add_mantenance.php | UTF-8 | 10,378 | 2.59375 | 3 | [] | no_license | <?php require_once('../Connections/IT.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$t... | true |
62fd0df023dee22fd7404f6ee40ff343570860dd | PHP | brijeshmkt/fernleaf | /checkout.php | UTF-8 | 12,087 | 2.75 | 3 | [] | no_license | <?php
/*
Template Name: Checkout Page
*/
session_start();
class Child {
public $Age;
public function __construct() {
$this->Age = array();
}
public function addAge( $age ) {
$this->Age[] = $age;
}
}
class TourDetails {
public $Tours;
public function __contruct() {
$this->Tours = array();
}
public fu... | true |
e30b751e2459f7203f75b0380a8ce84180e765e7 | PHP | yalsicor/treeo_api | /app/Containers/Village/Tasks/DeleteVillageTask.php | UTF-8 | 840 | 2.734375 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | <?php
namespace App\Containers\Village\Tasks;
use App\Containers\Village\Data\Repositories\VillageRepository;
use App\Ship\Exceptions\DeleteResourceFailedException;
use App\Ship\Parents\Tasks\Task;
use Exception;
/**
* Class DeleteVillageTask
*
* @author Sebastian Weckend <sebastian.weckend@posteo.de>
*/
class D... | true |
552ddb70f26d61e5dd0af40fbde1da7fe795c436 | PHP | soitun/edusoho | /migrations/20210823191005_alter_multi_class_group_name.php | UTF-8 | 550 | 2.546875 | 3 | [] | no_license | <?php
use Phpmig\Migration\Migration;
class AlterMultiClassGroupName extends Migration
{
/**
* Do the migration
*/
public function up()
{
$biz = $this->getContainer();
$biz['db']->exec("ALTER TABLE `multi_class_group` ADD COLUMN `seq` int(10) NOT NULL DEFAULT 0 COMMENT '分组序号' AFT... | true |
e93c6f19da6f3a203769bef56c199fdbd2a288f5 | PHP | dbohn/FU-Kundenprojekt-2016-17 | /humhub/protected/modules/bcs/repositories/BcsUserRepository.php | UTF-8 | 1,794 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
namespace humhub\modules\bcs\repositories;
use yii\db\Connection;
class BcsUserRepository
{
/**
* @var Connection
*/
private $postgres;
public function __construct(Connection $postgres)
{
$this->postgres = $postgres;
}
/**
* @param $username
* @return arra... | true |
6c7a575cdacadb71a89520a346b5f5b9831cd774 | PHP | msilanus/arduinoRpiMySQL | /affichage.php | UTF-8 | 761 | 2.71875 | 3 | [] | no_license | <?php
try
{
mysql_connect ('127.0.0.1', 'root', 'monMotDePasseMySQL');
mysql_select_db('myBDD');
echo 'Connexion réussi a la base de donnée<br>';
}
catch (Exception $e)
{
die('Erreur : ' . $e->getMessage());
}
?>
<table width="400px">
<thead>
<tr>
<td with="40%"> Heure</td>
... | true |
7af9d3ad1cdfcd46e1c569bc749c4c715c2065a9 | PHP | sanjayvekariya18/onepitch | /app/Models/PitchClickTrack.php | UTF-8 | 1,086 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* App\Models\PitchClickTrack
*
* @property int $id
* @property int $pitch_id
* @property \Carbon\Carbon|null $created_at
* @property \Carbon\Carbon|null $updated_at
* @property-re... | true |
c52862681138d6f9b52b400b23ca96f872068625 | PHP | zhangcheng1006/Web-Applications-Animal-adoption | /project/utils/Utilisateur.php | UTF-8 | 7,153 | 3.421875 | 3 | [] | no_license | <?php
//ce fichier php contient la class "Utilisateur" qui correspond au tableau 'utilisateurs' dans la base de donnees
class Utilisateur {
public $login;
public $mdp;
public $email;
public $type;
//fonction __toString() affiche les informations d'un utilisateur pour debugger
public function... | true |
63d584362d8ff1ac7986a344fe399d0e43289bb2 | PHP | ReCodEx/api | /app/exceptions/ExerciseConfigException.php | UTF-8 | 871 | 2.625 | 3 | [
"BSD-3-Clause",
"GPL-2.0-only",
"MIT",
"Apache-2.0"
] | permissive | <?php
namespace App\Exceptions;
use Nette\Http\IResponse;
/**
* General exception used in all exercise configuration helpers in case
* of error. Usually concerning bad structure or bad value type.
*/
class ExerciseConfigException extends ApiException
{
/**
* Create instance with further description.
... | true |
75ce00b20a8c60977f106f25d35acf5e4380ff32 | PHP | behnamhatami/91-2-Web-HW2 | /php/util.php | UTF-8 | 5,912 | 2.859375 | 3 | [] | no_license | <?php
/**
* Created by JetBrains PhpStorm.
* User: Behnam
* Date: 4/6/13
* Time: 11:09 PM
* To change this template use File | Settings | File Templates.
*/
define('url_base', 'http://cinematicket.org');
define('encoding', 'UTF-8');
function time_to_int($in)
{
return ($in - $in % 100) + intval... | true |
7ea2d35cb2291f1844031dd331476ccd80f47f9f | PHP | MarioPerezRodriguez/smr2b_mario | /else_b.php | UTF-8 | 148 | 2.734375 | 3 | [] | no_license | <?php
$nota = 8.5;
$r= 'PENDIENTE';
if ($nota>=5)
$r= 'APROBADO';
if($nota>=7)
$r='NOTABLE';
if ($nota>=8.5)
$r= 'SOBRESALIENTE';
echo $r; | true |
7f9813c9060b061b1f6a6ece71f84f1d7d6c4654 | PHP | brainsum/minit.cz | /lib/Brainsum/App.php | UTF-8 | 5,807 | 2.640625 | 3 | [] | no_license | <?php
namespace Brainsum;
use ReCaptcha\ReCaptcha;
class App
{
/** @var Config - Configuration options */
protected static $_config;
/** @var string - Protocol scheme (http, https) */
protected static $_scheme;
/** @var Router - Path/logic abstraction */
protected static $_router;
/** ... | true |
4e67d8a98d47571f2f0509691f4004ba3571038a | PHP | mattswkim/WebDevCollection1 | /php/practice.php | UTF-8 | 3,006 | 3.796875 | 4 | [] | no_license | <?php
echo "<h2>Variables</h2>";
$name = "Matt";
echo "<p>My name is $name</p>";
$string1 = "<p>This is the first part";
$string2 = "of a sentence</p>";
echo $string1." ".$string2;
$myNumber = 45;
$calculation = $myNumber = 31 / 97 + 4;
echo "The result of the calculation is ".$calculation;
$myBool = true;
ec... | true |
f3546ac7909c8c85689b8ae4a8a642051c0e8df9 | PHP | lavary/menus | /src/Renderer/Ol.php | UTF-8 | 926 | 2.984375 | 3 | [
"MIT"
] | permissive | <?php
namespace Lavary\Menus\Renderer;
use Lavary\Menus\Common\Attr;
class Ol extends Element
{
/**
* Stores attributes of the <ul> tag
*
* @var array
*/
protected $attributes = [];
/**
* Stores attributes of the inner <ul> tags
*
* @var array
*/
protected $dr... | true |
3ed1eed80f29368b5772c7628a196176786c3cdb | PHP | HarryButtowski/parser-ngs | /components/parser/Parser.php | UTF-8 | 611 | 2.75 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace app\components\parser;
use yii\base\Component;
/**
* Class Parser
* @package app\components\parser
*/
class Parser extends Component
{
/**
* @param Provider $provider
* @param HandlerOfData $handler
* @param array $params
*
* @return array
*/
publ... | true |
13b7c1b8dd0b4a6ba450abbff9a90e81040d1524 | PHP | zzh1/redis_introduction_and_application | /list.php | UTF-8 | 242 | 2.515625 | 3 | [] | no_license | <?php
$redis = new \Redis();
$redis->connect('127.0.0.1',7200);
//list 操作
$redis->delete("list1");
$redis->lPush("list1","A");
$redis->lPush("list1","B");
$redis->lPush("list1","C");
$val = $redis->rPop("list1");
var_dump($val);
| true |
66e2a54b70e9c2328cf9542c3e2b320fd7a6d568 | PHP | NHURTEVENT/Projet-Web | /Website/src/Entity/LikedPhoto.php | UTF-8 | 838 | 2.515625 | 3 | [] | no_license | <?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\LikedPhotoRepository")
*/
class LikedPhoto
{
/**
* @ORM\Id
* @ORM\ManyToOne(targetEntity="User")
*/
private $user_id;
/**
* @ORM\Id
* @ORM\ManyToOne(targetEntity="Ph... | true |
b5945770bd68fbffd1ff419eea7ab25af70b3a23 | PHP | Sk8rSeth/Milestones | /M4/POS/EditCustomer.php | UTF-8 | 1,353 | 2.796875 | 3 | [] | no_license | <?php
require_once("initialize.php");
$id = getGet('customer_id');
$delete = '';
$sql = "
SELECT *
FROM customer
WHERE id = :id
";
$sql_values = [
':id' => $id
];
$stmt = DB::prepare($sql);
DB::execute($stmt, $sql_values);
$results = $stmt->fetchAll();
$info = '';
$female = '';
$male = '';
foreach($results a... | true |
53582de95756b3e475a6d4963f8c7c33968813e8 | PHP | amy61789/itc250NewsAggregator | /feed.php | UTF-8 | 4,257 | 3.03125 | 3 | [] | no_license | <?php
//feed.php
//our simplest example of consuming an RSS feed
require '../inc_0700/config_inc.php'; #provides configuration, pathing, error handling, db credentials
//sql statement to select individual item
if(isset($_GET['id']) && (int)$_GET['id'] > 0){#proper data must be on querystring
$myID = (int)$_GET['id'];... | true |
cb4cd9222450dbc2ed41e283d7f0305cb0c1fbf8 | PHP | FatimaYacoubi/PureBowl | /PureBowl/Controller/DishC.php | UTF-8 | 3,006 | 3.03125 | 3 | [] | no_license | <?PHP
include "../config.php";
require_once '../Model/Dish.php';
class DishC {
function addDish($dish){
$sql="INSERT INTO dishes (name, ingredients, price,etat)
VALUES (:name, :ingredients, :price,1)";
$db = config::getConnexion();
try{
$query = $db->prepare($sql);
$query->execute([
... | true |
0268c4bc43eef62f8b228741572c1f9fa391c504 | PHP | 4yop/miscellaneous | /PHP/redis/redis-lock/do.php | UTF-8 | 560 | 2.53125 | 3 | [] | no_license | <?php
use swoole\Process;
set_time_limit(0);
$key = "lock:test";
$ttl = 3000;
//cli_set_process_title('php-lock');
require_once 'RedLock.php';
$servers = [
['127.0.0.1', 6379, 0.01],
//['127.0.0.1', 6378, 0.01],
];
$redLock = new RedLock($servers);
... | true |
f8a0b0e43c540b94b139e108b85ea84cb0cb00ef | PHP | Damnval/joke_choice | /jobchoice_be2/sites/backend/app/Repositories/HatarakiKataRepository.php | UTF-8 | 1,604 | 2.8125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Repositories;
use Illuminate\Database\Eloquent\Model;
use App\Repositories\Contract\BaseRepositoryInterface;
use Carbon\Carbon;
class HatarakiKataRepository implements BaseRepositoryInterface
{
// model property on class instances
protected $hatarakiKata;
// Constructor to bind mode... | true |
57126178690bced566319e938887b6ba7314032b | PHP | notgroup/onlyads | /app/Models/Category.php | UTF-8 | 3,469 | 2.765625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Category extends Model
{
private $descendants = [];
public function children()
{
return $this->subcategories()->with('children');
}
public function hasChildren(){
if($this->children->count()){... | true |
92ca9d6602c976f1152a69cd36e8057fbc6c086d | PHP | pdawczak/onko | /apps/frontend/modules/pacjent/templates/_radioterapie.php | UTF-8 | 1,352 | 2.59375 | 3 | [] | no_license | <?php if (count($pacjent->getSortedRadioterapie()) > 0) : ?>
<!--<ul>-->
<?php foreach ($pacjent->getSortedRadioterapie() as $radioterapia) : ?>
<div class="cell-result-item">
<div class="result-item-date">
<?php echo myFormatDate($radioterapia->getDataRozpoczecia()) ?>
<?php if ($radioter... | true |
8a2eb2b5dafc9039e336e7dce71916ed108c1b24 | PHP | jblock15/phpstuff | /Day1-2/oddnumbers.php | UTF-8 | 239 | 3.40625 | 3 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<title>odd numbers</title>
</head>
<body>
<?php
function oddnumbers () {
for($i = 1; $i < 1000; $i +=2){
echo $i;
}
};
oddnumbers();
?>
</body>
</html>
| true |
97f4427384fd79b1e48a36e229b0dedc50f2ee66 | PHP | chenhx11/zj_web_demo | /_Business/BBaseFacade.class.php | UTF-8 | 3,115 | 2.640625 | 3 | [] | no_license | <?php
/**
*
* @authors xieq
* @date 2014-10-13 17:55:53
*/
abstract class BBaseFacade {
protected static $act;
protected static $url;
protected static $ss;
protected static $uid;
protected static $key;
protected static $token;
abstract static function share($name, $act);
abstrac... | true |
840a664b557b140ac73205c4eb560205bad333c9 | PHP | Joyboo/curl-oauth | /src/Weibo/Config.php | UTF-8 | 2,003 | 2.796875 | 3 | [] | no_license | <?php
/**
* @author gaobinzhan <gaobinzhan@gmail.com>
*/
namespace OAuth\Weibo;
use OAuth\BaseConfig;
class Config extends BaseConfig
{
protected $clientId = '';
protected $clientSecret = '';
protected $scope = '';
protected $display = 'default';
protected $forceLogin = false;
protec... | true |
3382657311c5e24e9ac17e754dfea8aa06d3ebf8 | PHP | emmanueldd/little_game | /classes/playerfactory.php | UTF-8 | 705 | 3.375 | 3 | [] | no_license | <?php
class PlayerFactory
{
private $_source;
public function __construct($source, $_i)
{
$this->_source = $source;
$this->makeAllPlayers($this->_source, $_i);
}
// crée les joueurs en utilisant Player
public function makeAllPlayers($line, $_i)
{
global $player;
... | true |
6429504270c76a914ec52e04de50ed356eae4b14 | PHP | carlosasjr/Treinamentos-PHP | /PHPZERO/Projetos/antigo/login.php | UTF-8 | 1,319 | 2.75 | 3 | [] | no_license | <?php require 'pages/header.php'; ?>
<div class="container">
<h1>Login</h1>
<?php
require 'classes/Usuarios.class.php';
$usuario = new Usuarios();
$dados = filter_input_array(INPUT_POST, FILTER_DEFAULT);
if (!empty($dados) && $dados['btnCadastro']) {
$email = $dados['email'];
... | true |