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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7ab425c934d8fb16ef6a22f14011ad9c2d636c6e | PHP | maciej-sz/nbp-php | /examples/trade-from-effective-day.php | UTF-8 | 595 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
require_once __DIR__ . '/../vendor/autoload.php';
use MaciejSz\Nbp\Service\CurrencyTradingRatesService;
$currencyTrading = CurrencyTradingRatesService::new();
$gbpFromApril4th = $currencyTrading->fromEffectiveDay('2023-04-04')->getRate('GBP');
printf(
'%s rate from %s effective ... | true |
db467f9b1c98e2a2991ad52fe615a0dedea27c9b | PHP | heremaps/flexible-polyline | /php/tests/FlexiblePolylineTest.php | UTF-8 | 2,240 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
namespace Heremaps\FlexiblePolyline\Tests;
use PHPUnit\Framework\TestCase;
abstract class FlexiblePolylineTest extends TestCase
{
protected static function getFilepath(string $relativePath): string
{
return sprintf(__DIR__ . '/../../test/%s', $relativePath);
}
protected static function... | true |
2068d84de6fad03dcac18a7d19fd49e360fb48f4 | PHP | topogigiovanni/recoil | /src/Kernel/Api/Sleep.php | UTF-8 | 1,360 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
namespace Recoil\Kernel\Api;
use Recoil\Coroutine\CoroutineInterface;
use Recoil\Coroutine\CoroutineTrait;
use Recoil\Kernel\Strand\StrandInterface;
/**
* Internal implementation of KernelApiInterface::sleep().
*
* @internal
*/
class Sleep implements CoroutineInterface
{
use CoroutineTrait;
public ... | true |
5963f0d873ca1caa4b6713994c8147b63eaeecf5 | PHP | faizalmuzakki/fp-cloud | /app/Models/Storage.php | UTF-8 | 659 | 2.578125 | 3 | [] | no_license | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class StorageType{
const types = [
0 => [
'name' => 'Small',
'spacemb' => 50,
'type_code' => 0,
],
1 => [
'name' => 'Medium',
'spacemb' => 100,
'type... | true |
1c144aa6936af16237cc269ec3b8839b03dab525 | PHP | jumper423/file-iterator | /src/FileIterator.php | UTF-8 | 910 | 3.296875 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace jumper423;
class FileIterator implements \SeekableIterator
{
private $position;
/**
* @var File
*/
private $file;
public function __construct($path)
{
$this->file = File::getInstance($path);
}
public function seek($position)
{
if ($position ... | true |
caa101ce88f46bae2e326469a451b0992b9b820f | PHP | bildvitta/navpi-php | /tests/Fields/DecimalFieldTest.php | UTF-8 | 1,377 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace Bildvitta\Navpi\Tests\Fields;
use Bildvitta\Navpi\Fields\DecimalField;
class DecimalFieldTest extends FieldsTestCase
{
protected DecimalField $decimalField;
public function test_field_name()
{
$this->assertEquals('decimalField', $this->decimalField->getName());
}
public ... | true |
db62f3daed444b63c82e0f1c79e04349caa2a8b1 | PHP | Ehesp/govspend | /xml.php | UTF-8 | 368 | 2.921875 | 3 | [] | no_license | <?php
// URL etc... In this instance for simplicity the XML is in a text file
$fileContents = file_get_contents("xml-sample.txt");
$fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents);
$fileContents = trim(str_replace('"', "'", $fileContents));
$simpleXml = new SimpleXMLElement($fileCo... | true |
9c736a5069d3efa8b20ec116676a10464f6d7434 | PHP | yannlemen/PSI | /individu.php | UTF-8 | 7,863 | 2.65625 | 3 | [] | no_license | <?php
session_start();//session_start() combiné à $_SESSION (voir en fin de traitement du formulaire) nous permettra de garder le pseudo en sauvegarde pendant qu'il est connecté, si vous voulez que sur une page, le pseudo soit (ou tout autre variable sauvegardée avec $_SESSION) soit retransmis, mettez session_start() a... | true |
0bb8aa014a7c8a78086bc2439866567b0b70a196 | PHP | barfly87/compass | /application/default/models/maintenance/MaintenanceLectopiaMedvid.php | UTF-8 | 3,000 | 2.8125 | 3 | [] | no_license | <?php
class MaintenanceLectopiaMedvid extends MaintenanceAbstract {
public function process() {
$errorMsg = '';
$error = false;
//REINDEX LECTOPIA COLLECTION
$mediabankCollectionService = new MediabankCollectionService();
$lectopiaReindex = $mediabankCollectionS... | true |
74bcb50ce0bcaace61c0985be7594a9b41b2dfd1 | PHP | hackingangle/web-tech | /patterns/autoload/main_0.php | UTF-8 | 178 | 3.171875 | 3 | [] | no_license | <?php
/**
* 创建一个人,并说一句话好了
*
* using:
* 蛮荒时代
*/
require_once __DIR__. "/Person.class.php";
$objPerson = new Person();
$objPerson->say();
| true |
7bb368b6d1fe4299533583483ab382a0771d7ade | PHP | Avenax/webcom-group | /class/User.php | UTF-8 | 1,896 | 2.828125 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: Avenax
* Date: 08.11.2018
* Time: 16:04
*/
class User extends BaseClass {
/**
* Регистрация
* @param $login
* @param $password
*/
public static function setRegister($login, $password)
{
$db = Db::getInstance();
$sql = $db->p... | true |
b523ef623b1bccd003241e612c9b0ed14a4356c7 | PHP | jumpalottahigh/beer-rating | /beers.php | UTF-8 | 1,913 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
// Fetch from the beer table and show data
foreach($connect->query('SELECT * FROM beers') as $beer_row) {
echo '<!-- Card start -->
<div class="col-xs-12 col-sm-6">
<div class="card" data-beer-id="'.$beer_row['id'].'">
<div class="col-xs-4">
<img class="... | true |
587abbfeec606375114aedc03405fb5710dd0627 | PHP | lgc52/face | /application/tool/controller/Tool.php | UTF-8 | 3,356 | 2.625 | 3 | [
"Apache-2.0",
"PHP-3.0"
] | permissive | <?php
namespace app\tool\controller;
class Tool
{
protected static $_instance=null;
public static function getInstance()
{
if (self::$_instance === null) {
self::$_instance = new self;
}
return self::$_instance;
}
private $url = '';
private $param = [];... | true |
f59777db731b3ec5967c4186a3eab108ed1ffd65 | PHP | hellenaa/symfony-shop-test-project | /src/AppBundle/Entity/Country.php | UTF-8 | 1,492 | 2.671875 | 3 | [] | no_license | <?php
namespace AppBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="AppBundle\Repository\CountryRepository")
* @ORM\Table(name="countries")
*/
class Country extends BaseEntity
{
/**
... | true |
dace6d1d316a69587a80f9660a3526d13e40283b | PHP | Web5design/Borkers | /functions/helpers.php | UTF-8 | 280 | 2.828125 | 3 | [] | no_license | <?php
/**
* @package WordPress
* @subpackage Borkers
*
* Comments: A collection of helper functions for debugging, etc.
*/
// pr() will print_r wrapped in a <pre> tag. Taken from CakePHP.
function pr( $content = null ) {
echo "<pre>";
print_r($content);
echo "</pre>";
} | true |
e1e22e22788603ce405615fd104006eda23c7847 | PHP | eljebus/Refanet2.0 | /app/BuyMe/Repos/MarkRepo.php | UTF-8 | 591 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php namespace BuyMe\Repos;
use BuyMe\Entities\Marca;
class MarkRepo extends BaseRepo{
public function getModel()
{
return new Marca;
}
public function getAll(){
return Marca::where('Status','=','1');
}
public function getByName($name){
return Marca::where('Nombre','=',$n... | true |
19140958d31f64e3d3445c306b8e834f54976f17 | PHP | htmlacademy-yii/514921-task-force-1 | /src/services/ProfileService.php | UTF-8 | 1,472 | 2.75 | 3 | [] | permissive | <?php
namespace TaskForce\services;
use frontend\models\FavouriteUsers;
use frontend\models\Profiles;
use Yii;
class ProfileService
{
public function addFavouriteUser(int $userId): bool
{
$currentUser = Yii::$app->user->getIdentity();
if ((int)$currentUser->getId() === (int)$userId) {
... | true |
f7916da54f31278acc779dece08286375b0a683b | PHP | qusaisafa/LaravelPlacesSearch | /app/Http/Controllers/SearchController.php | UTF-8 | 1,699 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Place;
use App\Utils;
use App\GoogleStatics;
class SearchController extends Controller
{
public function index()
{
return "Search API working";
}
public function search(Request $request)
{
$allMatchedPlace... | true |
4311f6005cca3fda55b876961f2076f8a578c27f | PHP | 023-MasterChip/esports | /api/v1/objects/result.php | UTF-8 | 9,811 | 2.984375 | 3 | [] | no_license | <?php
class result
{
// database connection and table name
private $conn;
private $table_name = "results";
// object properties
public $result_id;
public $event_id;
public $team_id;
public $position;
public $overview;
public $published;
public $removed;
// constructor ... | true |
25aae1e153581a785e022b7c898da91099bad0c1 | PHP | dundivet/codespring | /src/Caribbean/TourismBundle/Command/RandomImagesCommand.php | UTF-8 | 1,574 | 2.671875 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: luis
* Date: 5/03/15
* Time: 19:56
*/
namespace Caribbean\TourismBundle\Command;
use Caribbean\TourismBundle\Entity\Imagen;
use Caribbean\TourismBundle\Entity\POI;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputA... | true |
820c54231f3d06c9f0f2d6541a842f988ef33952 | PHP | roddon/DeepCheck | /app/repositories/BaseRepository.php | UTF-8 | 1,360 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Repositories;
use Sentry;
use Throwable;
use Auth;
class BaseRepository
{
/**
* @param Throwable $e
* @return RedirectResponse
*/
public function logExceptionAndRespond(Throwable $e)
{
Sentry::captureException($e);
return redirect()->back()->with(['err... | true |
4122dcc531dfaf7fff1f58daea5f275ca89f2bfc | PHP | Yann-Tricot/YouStats | /src/Entity/Tag.php | UTF-8 | 774 | 2.75 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Tag
*
* @ORM\Table(name="TAG")
* @ORM\Entity
*/
class Tag
{
/**
* @var int
*
* @ORM\Column(name="tag_id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $tagI... | true |
972994f411b832bb39c3878a37c8b7767cc33e86 | PHP | samersm/web-dev | /php/index.php | UTF-8 | 1,668 | 3.4375 | 3 | [] | no_license | <?php
echo "This is PHP!";
$test="I'm a variable!";
$test2="Me too!";
$number=75;
$name="what";
$a="name";
echo $test.$test2;
echo $number/3;
echo "My name is $name";
echo $$a;
$myArray=array("pizza", "chocolate", "coffee");
print_r($myArray);
echo $myArray[2];
echo "<br /><br />";
$anotherArray[0]... | true |
a6d81485e1d6ab0c6029ba6ff83433fe01f630a4 | PHP | A-Marzouk/resume-manager | /app/Http/Controllers/SkillsController.php | UTF-8 | 1,519 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: Ahmed
* Date: 7/25/2018
* Time: 6:39 PM
*/
namespace App\Http\Controllers;
use App\Skill;
use Illuminate\Http\Request;
class SkillsController extends Controller
{
public function getSkills(){
// get current authenticated freelancer :
$currentUser = au... | true |
8fb7016af785352c8304246e041ff8cee2f04e20 | PHP | csanchez19/ShowDown | /application/models/tourns_model.php | UTF-8 | 8,781 | 2.59375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
class tourns_model extends CI_Model{
public function __construct()
{
$this->load->database();
}
//SELECT JOCS REGISTER
public function sel_jocs(){
$query = $this->db->query('SELECT * FROM joc');
return $query->result();
}
... | true |
934fabc2f99f4ff915b0434b4326ac59bb126533 | PHP | vinz2100/canetown-wd3-b2-Vinz | /WBD3_B2/PHP ACT/NumComparing.php | UTF-8 | 1,176 | 3.25 | 3 | [] | no_license | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<form action="" method="GET">
<h3>Finding the largest number</h3>
<input type="text" name="txt1"><br><br>
<input... | true |
753004762b29a11d03bd3b367246676de85d2a13 | PHP | bruutenbraaf/leerbouwen | /templates/uitzendplaats-vacancy-index.php | UTF-8 | 2,633 | 2.578125 | 3 | [] | no_license | <?php
/**
* Provide a view for the vacancy index page
*
* @link https://www.uitzendplaats.nl
* @since 1.0.0
*
* @package Uitzendplaats
* @subpackage Uitzendplaats/public/templates
*/
?>
<?php
if ($_POST && array_key_exists('uzp_vacancy_search', $_POST) && (!empty($search_query) || !empty($search_postal_code) |... | true |
36dcd3ab60aa22b4ca18539e5c22d84712707752 | PHP | kienhuynh279/web_english | /app/Http/Requests/AddPostCatsRequest.php | UTF-8 | 1,418 | 2.640625 | 3 | [] | no_license | <?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class AddPostCatsRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Ge... | true |
2e98cb727aca611fedbe8383dc837919f62bd063 | PHP | fredy-aunta/tenis-mesa | /backend/application/modelo/Nodo.php | UTF-8 | 1,174 | 3.328125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: fredy
* Date: 4/03/2018
* Time: 6:41 PM
*/
class Nodo
{
/**
* @var integer
*/
public $dato;
/**
* @var Nodo
*/
public $izq, $der;
public function __construct($dato = null, $izq = null, $der = null)
{
if (!is_null($dato))... | true |
65d2be5b3427436c406676d8a272069480f7a15b | PHP | wingsergey/wms | /flex/src/Validator/Api/Warehouse.php | UTF-8 | 1,781 | 2.5625 | 3 | [] | no_license | <?php
namespace App\Validator\Api;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Class Warehouse
* @package App\Validator\Api
*/
class Warehouse extends AbstractValidator
{
/**
* @param Request $request
* @return \Symfony\Component\Validat... | true |
d814f29c62279f4340b1b5c719a7a1fde2215d58 | PHP | kingkong90/cursophp | /02.poo/codigoPoo.php | UTF-8 | 349 | 3.59375 | 4 | [] | no_license | <?php
class Automovil{
#Declaro las propiedades
public $marca;
public $año;
public $estado;
#Declaro los metódos
function mostrar(){
echo "soy el auto $this->marca, año $this->año";
}
}
#Instancio al objeto de la clase
$a = new Automovil();
$a -> marca = "Toyota";
$a -> año = "201... | true |
7f4d6c4b3c7b347f76ff40b7403a176bc21ee4d5 | PHP | levon1998/box-price | /database/seeds/PassiveIncomesSeeder.php | UTF-8 | 2,041 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Seeder;
class PassiveIncomesSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$passiveIncomes = [
[
'title' => 'Малинки Источник',
'description' => '3 рубля... | true |
e330be135aa5d9484b645221ce40f74c70a29499 | PHP | ilya-dev/little | /examples/demo.php | UTF-8 | 1,172 | 3.21875 | 3 | [
"MIT"
] | permissive | <?php namespace Little\Examples;
# we do not leverage the Composer autoloader for the examples folder
require __DIR__.'/classes.php';
require __DIR__.'/../src/Little.php';
$little = new \Little;
###
# this code shows automatic dependency resolution,
# the ability to bind existing instances, bindings
echo "\n\nEXAMP... | true |
0e6a4765f3665343119998ebeff8ed392d17074d | PHP | neeleshchouksey/kalars | /klrdmin/app/Models/AdminModel.php | UTF-8 | 2,117 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use CodeIgniter\Database\ConnectionInterface;
use CodeIgniter\Model;
class AdminModel
{
protected $db;
protected $user_data;
public function __construct(ConnectionInterface &$db)
{
$this->db =& $db;
$session = session();
$this->user_data = $sessio... | true |
b2cb183a5fcf345e4a647b7a8d584e744a7c9832 | PHP | kbond/ZenstruckDataGridBundle | /Grid.php | UTF-8 | 2,034 | 2.625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | <?php
namespace Zenstruck\DataGridBundle;
use Zenstruck\DataGridBundle\Executor\ExecutorInterface;
use Zenstruck\DataGridBundle\Field\FieldCollection;
use Zenstruck\DataGridBundle\Filter\FilterInterface;
use JMS\Serializer\Annotation as Serializer;
/**
* @author Kevin Bond <kevinbond@gmail.com>
*
* @Serializer\Ex... | true |
cb6248ff4dac11e8f2ede4c3a32d2ccbf2d8c236 | PHP | IshraqKabir/php-mvc-blog | /App/Controllers/Profiles.php | UTF-8 | 1,180 | 2.53125 | 3 | [] | no_license | <?php
namespace App\Controllers;
use Core\View;
use App\Models\Post;
use App\Models\Comment;
use App\Models\User;
class Profiles {
public function userProfile($user_id) {
$user = User::getUserByID($user_id);
$allPosts = Post::getPostByUserID($user_id);
for ($i = 0; $i < count($allPosts); $i++) {
... | true |
c858cb6fc07d4a58813db32156db1a26fdfbcf2d | PHP | arnia/KarybuShop | /tests/lib/TestAgainstDatabase.php | UTF-8 | 1,114 | 2.53125 | 3 | [] | no_license | <?php
require_once "PHPUnit/Extensions/Database/TestCase.php";
require dirname(__FILE__) . '/Database.php';
/**
* Base class for tests using a database
*
* @author Corina Udrescu (php@arnia.ro)
*/
abstract class TestAgainstDatabase extends PHPUnit_Extensions_Database_TestCase
{
protected $backupGlobals = FALSE;
... | true |
b4d228efb93d97259ab4c6a83b4beb083603e353 | PHP | HananMohammed/ecomm-api | /app/Traits/GeneralTrait.php | UTF-8 | 2,146 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Traits;
use Illuminate\Support\Facades\Auth;
Trait GeneralTrait
{
/**
* @param $request
* @param $model
* @throws
*/
public function storeData($request, $model)
{
foreach ( $request->input() as $key => $value)
{
if($key !='_token' && $k... | true |
7d7831296d6bed236d9bc0e8c00ea53411b90dad | PHP | asmecher/pkp-lib | /classes/security/authorization/internal/QueryRequiredPolicy.inc.php | UTF-8 | 1,879 | 2.6875 | 3 | [] | no_license | <?php
/**
* @file classes/security/authorization/internal/QueryRequiredPolicy.inc.php
*
* Copyright (c) 2014-2017 Simon Fraser University
* Copyright (c) 2000-2017 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @class QueryRequiredPolicy
* @ingroup security_auth... | true |
7f46336da54093cdc6d7b2265c1c9cd46173e281 | PHP | hubzero/framework | /src/Oauth/Server.php | UTF-8 | 3,254 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
/**
* @package framework
* @copyright Copyright (c) 2005-2020 The Regents of the University of California.
* @license http://opensource.org/licenses/MIT MIT
*/
namespace Hubzero\Oauth;
use OAuth2\Server as OAuth2Server;
use Hubzero\Oauth\Storage\Mysql as MysqlStorage;
use Hubzero\Oauth\GrantType\Refr... | true |
0d580083f90f577ce4f90a9f8a3ac1ec1dfecbb9 | PHP | nilnice/phalcon-framework | /src/Exception/ErrorHandler.php | UTF-8 | 2,742 | 2.796875 | 3 | [] | no_license | <?php
namespace Nilnice\Phalcon\Exception;
use ErrorException;
use Exception;
class ErrorHandler
{
/**
* Register exception and error handler.
*
* @return void
*/
public static function register(): void
{
set_error_handler([__CLASS__, 'handleError']);
set_exception_han... | true |
5158007299c3ca5663b5e5df5b70c287584a8433 | PHP | maqmaq/hooks | /src/BlankLines.php | UTF-8 | 391 | 3.09375 | 3 | [] | no_license | <?php
namespace Acme\Package;
use Acme\AnotherFoo;
use Acme\AnotherBar;
class Foo
{
public $x;
public $y;
public function foo()
{
}
}
class Bar
{
const X = 1;
const Y = 2;
public $a;
public $b;
public function bar()
{
$a = "a";
$b = "b";
}
pub... | true |
c6284910747ea038366410e6fd0a32d1b150a974 | PHP | sistemasrampublicidad/marpro1 | /app/CoreFacturalo/Greenter/Model/Voided/VoidedDetail.php | UTF-8 | 1,727 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: Giansalex
* Date: 15/07/2017
* Time: 22:00.
*/
namespace App\CoreFacturalo\Greenter\Model\Voided;
/**
* Class VoidedDetail.
*/
class VoidedDetail
{
/**
* @var string
*/
private $tipoDoc;
/**
* @var string
*/
private $serie;
/**
... | true |
d5528187abfb1f8114caf2c208903ac8e4fe3bdb | PHP | difercast/sispro | /app/database/migrations/2014_03_17_174039_create_users_table.php | UTF-8 | 950 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
/**
*
* @Sistema de gestión de reparaciones de equipos informáticos de Sisprocompu
* @versión: 1.0 @modificado: 17 de marzo del 2014
* @autor: Diego C.
*
*/
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration {
/**
* Run the m... | true |
346033b3077789d99dd8d990c29c74442aa99f21 | PHP | chloeadams/Codeup-Exercises | /function_writing_warmUp.php | UTF-8 | 506 | 3.765625 | 4 | [] | no_license | <?php
$firstLetterCaptitalizedInput = " "
function makeItTitleCase (str) {
return ucFirst(strToLower($str));
}
echo makeItTitleCase("aBc");
$firstName = ""
$lastName = ""
function greeting ($firstName, $lastName) {
$output = " " ;
$output = "$firstName", "$lastName"
if (is_string($firstName) && is_string($... | true |
ac750304b9262a78731442ccb60c2beda90b2ccf | PHP | noelzahra/php | /php7_irawan/02_Fundamental_PHP_Techniques/rev/spaceship_operator.php | UTF-8 | 423 | 3.65625 | 4 | [] | no_license | <?php
//spaceship operator
$array = [60, 90, 40, 10];
function ascending($arr): array
{
usort($arr, function($num1, $num2){
return $num1 <=> $num2; //ascending order
});
return $arr;
}
var_dump(ascending($array));
function descending($arr): array
{
usort($arr, function($num1, $num2){
... | true |
e2e1c74abf9c99f867f13dc6bf5c9a26f8b14e81 | PHP | corporation9/sendportal-core | /src/Models/Campaign.php | UTF-8 | 8,259 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Sendportal\Base\Models;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
class Campaign extends BaseModel
{
/** ... | true |
7c6749e46082390d43268a775aedd179d9887b7a | PHP | Swejzi/mpapi-client-php | /src/Entity/PartnerDelivery.php | UTF-8 | 2,137 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace MPAPI\Entity;
/**
* Partner delivery entity
*
* @author Martin Drlik <martin.drlik@mall.cz>
*/
class PartnerDelivery extends AbstractDelivery
{
/**
*
* @var string
*/
const KEY_DELIVERY_METHOD_ID = 'delivery_method_id';
/**
*
* @var string
*/
const KEY_EXTERNAL_ID = 'external_id';... | true |
b973d940431e35f158d91e6c819168b6ae9c024c | PHP | eonx-com/auditing | /src/Services/Factories/StreamFactory.php | UTF-8 | 794 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
declare(strict_types=1);
namespace LoyaltyCorp\Auditing\Services\Factories;
use GuzzleHttp\Psr7\BufferStream;
use Psr\Http\Message\StreamInterface;
use Zend\Diactoros\StreamFactory as ZendStreamFactory;
final class StreamFactory extends ZendStreamFactory
{
/**
* Overriding Zend\Diactoros\StreamFactory... | true |
bd6644cfd1af41b80ef9f4dd98153c973f4832d3 | PHP | webdados/Private-Media | /plugin.php | UTF-8 | 13,222 | 2.625 | 3 | [] | no_license | <?php
/*
Plugin Name: Private Files (MPH)
Description: Upload files that are only accessable to logged in users.
Author: Matthew Haines-Young
Version: 1.0.6
Author URI: http://www.matth.eu
*/
/*
TODO
nonce verification?
*/
// Admin Notices Abstraction.
require( 'class.mph-minify-notices.php' );
// Hash for obscu... | true |
f6d4f76784d6f1bfe81902780444aa89a800c3c7 | PHP | BailleuxThomas/php | /Paramètres/exo3.php | UTF-8 | 320 | 3.0625 | 3 | [] | no_license | <?php
if (isset($_GET['dateDebut']) AND isset($_GET['dateFin'])) // On a le nom et le prénom + age
{
echo 'Bonjour nous sommes le ' . $_GET['dateDebut'] . ' ' . $_GET['dateFin'] . ' !';
}
else // Il manque des paramètres, on avertit le visiteur
{
echo 'Il faut renseigner une date de début , une date de fin!';
}
?> | true |
6d9161b993429f4ca076cab89e562962d86e78b5 | PHP | leroy0211/rest-client-sdk | /src/Mapping.php | UTF-8 | 5,317 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
namespace Mapado\RestClientSdk;
use Mapado\RestClientSdk\Exception\MappingException;
/**
* Class Mapping
* @author Julien Deniau <julien.deniau@mapado.com>
*/
class Mapping
{
private $idPrefix;
private $idPrefixLength;
private $mapping = [];
/**
* __construct
*
* @param str... | true |
cdaf958265071b0c58eca697d80fece5ce6323d9 | PHP | igokul1973/supplies.nodaart | /_protected/backend/models/ProductSearch.php | UTF-8 | 2,661 | 2.640625 | 3 | [] | no_license | <?php
namespace backend\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use backend\models\Product;
/**
* ProductSearch represents the model behind the search form about `backend\models\Product`.
*/
class ProductSearch extends Product
{
// adding public attributes that will be used to st... | true |
870a142c54cd2c9bca5878d401ca0a4f8b5e499c | PHP | zigmoo/myth-auth | /src/Authorization/PermissionModel.php | UTF-8 | 1,956 | 2.90625 | 3 | [
"MIT"
] | permissive | <?php namespace Myth\Auth\Authorization;
use CodeIgniter\Model;
class PermissionModel extends Model
{
protected $table = 'auth_permissions';
protected $allowedFields = [
'name', 'description'
];
protected $useTimestamps = false;
protected $validationRules = [
'name' => 'required... | true |
f68b9fcb74e7a73230e4ca8619ffc9f3b31893fe | PHP | harvard-library/acorn | /application/default/views/forms/customelements/RepositorySelectForm.php | UTF-8 | 4,806 | 2.53125 | 3 | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive | <?php
/**
* Copyright 2016 The President and Fellows of Harvard College
*
* 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
*
*... | true |
9dde7d90c4289226f49d158637a4ac3088616f99 | PHP | Artfulbd/my_vlog | /platform/plugins/analytics/src/GA4/Traits/DimensionTrait.php | UTF-8 | 523 | 2.78125 | 3 | [] | no_license | <?php
namespace Botble\Analytics\GA4\Traits;
use Google\Analytics\Data\V1beta\Dimension;
trait DimensionTrait
{
public array $dimensions = [];
public function dimension(string $name): self
{
$this->dimensions[] = (new Dimension())
->setName($name);
return $this;
}
p... | true |
58ce629fa5333bef6ed72b742406a9ff450f9c81 | PHP | mat94b/Rixrank---PHP-MySQL-HTML | /www/application/models/translators_login_set_data.php | UTF-8 | 3,575 | 2.5625 | 3 | [] | no_license | <?php
class PageModel extends Model
{
public function __construct($Options){
parent::__construct();
if(isset($Options['translate'])){
$Result = $this->QueryDatabase("SELECT * FROM languages WHERE id='".$Options['id']."' and country=".$Options['country'].";");
$New_Data = $t... | true |
e2df1757ee699210c0d24d2ab6afa0aac18cc53b | PHP | Innmind/Http | /src/Header/Authorization.php | UTF-8 | 1,118 | 3.03125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types = 1);
namespace Innmind\Http\Header;
use Innmind\Http\Header as HeaderInterface;
use Innmind\Immutable\Set;
/**
* @psalm-immutable
*/
final class Authorization implements HeaderInterface
{
private Header $header;
private AuthorizationValue $value;
public function __construct... | true |
2dec9b1456efc3f355f6b067a5b81ea56251a470 | PHP | alexbrady32/counseling-notes | /getDatabaseData.php | UTF-8 | 874 | 2.65625 | 3 | [] | no_license | <?php
$dbConnection = new PDO('mysql:dbname=session_note;host=localhost;charset=utf8', 'root', 'SessionNotes15');
$table = filter_input(INPUT_GET, 'table');
$fieldNames = [];
$selectQuery = '';
$tableNamesQuery = $dbConnection->prepare( "
SELECT `COLUMN_NAME`
FROM `INFORMATION_SCHEMA`.`COLUMNS`
WHERE `TABLE... | true |
ebb2ad3c2baab002c95ef66c7fdd826d62ae789a | PHP | rahulyhg/happy-giraffe | /site/frontend/modules/scores/models/UserScores.php | UTF-8 | 4,952 | 2.609375 | 3 | [] | no_license | <?php
/**
* This is the model class for table "score__user_scores".
*
* The followings are the available columns in table 'score__user_scores':
* @property integer $user_id
* @property integer $scores
* @property integer $seen_scores
* @property integer $level_id
*
* The followings are the available model rel... | true |
37e059cc26a425d4353d14871157681fbc424662 | PHP | aviaialon/innovation-pedagogique | /Core/Interfaces/Base/ObjectBaseInterface.php | UTF-8 | 8,640 | 2.78125 | 3 | [] | no_license | <?php
/**
* Base Interface for objects
*
* @package Core
* @subpackage Interfaces
* @file Core/Interfaces/Base/ObjectInterface.php
* @desc Used interface for base objects implementations
* @author Avi Aialon
* @license BSD/GPLv2
*
* copyright (c) Avi Aialon (DeviantLogic)
* This source ... | true |
e0313acd1f4bd60da93109c8a0278be1f158904e | PHP | ttreeagency/ContentObjectProxy.Manager | /Classes/Domain/Model/ActionStack.php | UTF-8 | 1,961 | 2.59375 | 3 | [] | no_license | <?php
namespace Ttree\ContentObjectProxy\Manager\Domain\Model;
/*
* This file is part of the Ttree.ContentObjectProxy.Manager package.
*
* (c) Contributors of the project and the ttree team - www.ttree.ch
*
* This package is Open Source Software. For the full copyright and license
* information, please view the ... | true |
19137600cdb15a08171d8341074ebff1f3f42be5 | PHP | PeeHaa/amp | /lib/Message.php | UTF-8 | 3,257 | 3.1875 | 3 | [
"MIT"
] | permissive | <?php
namespace Amp;
use AsyncInterop\Promise;
/**
* Creates a buffered message from a Stream. The message can be consumed in chunks using the advance() and getCurrent()
* methods or it may be buffered and accessed in its entirety by waiting for the promise to resolve.
*
* Buffering Example:
*
* $message = new... | true |
ccb5fb741e02ef98330b314668892e822520e82f | PHP | sivasq/autohub | /application/modules/apiv1/controllers/User.php | UTF-8 | 2,192 | 2.53125 | 3 | [] | no_license | <?php
use Libraries\REST_Controller;
defined('BASEPATH') or exit('No direct script access allowed');
class User extends MY_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('User_model');
}
/*
* Format : { "userId":1, "firstName":"Ebin", "lastName":"Chandy", "addressL... | true |
d69a31c708ee891eec0965b85afae7633aad0936 | PHP | shaludama1/crm | /database/seeders/client_shopSeeder.php | UTF-8 | 776 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use DB;
class client_shopSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
for($i=1 ; $i<801 ; $i++)
{
$client = rand(1 , 1000);
$s... | true |
73fe5388235065c28ca07e3da53f9f21630eb1e2 | PHP | jokeofweek/ColdSite | /classes/FilterCache.php | UTF-8 | 463 | 3.03125 | 3 | [] | no_license | <?php
class FilterCache {
private $filters;
public function __construct(){
$this->filters = array();
}
public function loadFilter($name){
$className = 'Filter_'.$name;
$filter = new $className;
$this->filters[$name] = $filter;
}
public function get($name){
if (!array_key_exists($name, $this... | true |
9ee3500e7fde7a96336a4fe7cd808dd5e26bd76c | PHP | aboutcoders/workflow-bundle | /Model/TaskType.php | UTF-8 | 1,989 | 2.625 | 3 | [] | no_license | <?php
namespace Abc\Bundle\WorkflowBundle\Model;
/**
* TaskType
*/
class TaskType implements TaskTypeInterface
{
/**
* @var integer
*/
protected $id;
/**
* @var string
*/
protected $name;
/**
* @var string
*/
protected $icon = "";
/**
* @var string
... | true |
9a710ef046f1fba8daccb47509bc5e2f13d9846c | PHP | monteiroIuri/biblioteca | /app/bbs/Models/helper/BbsUpdate.php | UTF-8 | 2,787 | 3.140625 | 3 | [] | no_license | <?php
namespace App\bbs\Models\helper;
/**
* A classe BbsUpdate é classe filha da classe BbsConn, atualiza os registros no banco de dados
*
* @author Iuri Monteiro
*/
class BbsUpdate extends BbsConn
{
/** @var string $table Recebe o nome da tabela*/
private $table;
/** @var string $termos Recebe ... | true |
62b904658d8a4a883a552432e1c7056ffa49d55c | PHP | wangleiwynn/huawei-push | /src/Structure/Common/Button.php | UTF-8 | 3,173 | 3.21875 | 3 | [
"MIT"
] | permissive | <?php
namespace Afiqiqmal\HuaweiPush\Structure\Common;
use Afiqiqmal\HuaweiPush\Helper\ArrayHelper;
use Afiqiqmal\HuaweiPush\Structure\Validation\Extras;
class Button implements Extras
{
/**
* Button name, which is mandatory and cannot exceed 40 characters.
*
* @var string
*/
private $n... | true |
18280d4eac849b4e6bb061713b9623f2a1cf5dc1 | PHP | francescolaffi/twedi | /lib/Utils/StringUtils.php | UTF-8 | 991 | 2.90625 | 3 | [] | no_license | <?php
namespace lib\Utils;
class StringUtils {
/*public static function removeAccents($str, $from_enc = 'auto')
{
$str = mb_convert_encoding($str, 'HTML-ENTITIES', $from_enc);
$str = preg_replace(
array('/ß/','/&(..)lig;/','/&([aouAOU])uml;/','/&(.)[^;]*;/'),
array('ss',"$1","$1".'e',"$1"), $str);
... | true |
491ed8e241da5b2de136d520169d5a1019eb10d8 | PHP | Sectorr/Core | /Sectorr/Core/Auth/Auth.php | UTF-8 | 1,896 | 2.8125 | 3 | [
"MIT"
] | permissive | <?php
namespace Sectorr\Core\Auth;
use Sectorr\Core\Config;
use Sectorr\Core\Http\Session;
use Sectorr\Core\Input\Hash;
use Sectorr\Core\Input\Input;
class Auth
{
/**
* Returns the logged in user's data as an object.
*
* @return bool|object
*/
public static function user()
{
... | true |
c06342727b75ba3d3d010e4c2b5b2736b6f063a4 | PHP | cudilara/SecureWebProgramming | /DMadinger-HW7/add.php | UTF-8 | 9,876 | 3.046875 | 3 | [] | no_license | <?php
session_start();
// Name : add.php
// Purpose : a PHP page that handles adding to the database.
// Author : Dilara Madinger dilara.madinger@colorado.edu
// Version : 3.0
// Date: : 06/29/2016
include_once('header.php');
include_once('/var/www/html/hw7/hw7-lib.php');
connect($db);
if (!isset($_SESSION[... | true |
6ccc2c4edb77c78db31cbef1c3cd1490f750d0c6 | PHP | Attendize/Attendize | /database/migrations/2016_03_26_103318_create_attendees_questions.php | UTF-8 | 3,354 | 2.59375 | 3 | [
"BSD-3-Clause",
"AAL"
] | permissive | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAttendeesQuestions extends Migration
{
/**
* Run the migrations.
*
* @access public
* @return void
*/
public function up()
{
/**
* Checkbox, dropdown, radio, ... | true |
a4a2df50214b53c08a7b521bd63a28d0bb21ed81 | PHP | KarlaDampilag/your-personal-database-app | /save-object.php | UTF-8 | 1,661 | 2.921875 | 3 | [] | no_license | <?php
require_once 'config.php';
//If the user is not logged in, redirect to login page
if(!isset($_SESSION["loggedin"]) || $_SESSION["loggedin"] !== true){
header("location: login.php");
exit;
}
?>
<?php include 'header.php' ?>
<?php
$objectName = str_replace(' ', '_', strtolower($_POST['object-name']));
... | true |
92d30ce5627664cc6ee019318eb44087feb0b22c | PHP | abb1977/git_uchitsia | /admin/developer/pages/New folder/create_page_admin_PHP.php | UTF-8 | 4,607 | 2.53125 | 3 | [] | no_license | <?php
header("Content-Type: text/html; charset=utf-8");
//СОЗДАЁТ НОВУЮ СТРАНИЦУ И ЗАПОЛНЯЕТ ДАННЫЕ О НОВОЙ СТРАНИЦЕ В БАЗУ ДАННЫХ
include "../library/admin_library_db.php";
include "../library/admin_config.php";
$link = podkluchenieBD($domain, $login, $pass, $database); //Подключаемся к БД
//Переменные страницы
... | true |
aaa04e7335289cadc6a4eddecf83f9f06683545e | PHP | imajeed28/online-banking-system | /Includes/Reset-Request/admin-reset-request-inc.php | UTF-8 | 3,513 | 2.609375 | 3 | [] | no_license | <?php
if (isset($_POST["admin-reset-request-submit"])){
$selector = bin2hex(random_bytes(8));
$admin_token = random_bytes(32);
$url = "localhost/online-banking-system/admin-reset-password.php?selector=" . $selector . "&validator=" . bin2hex($admin_token);
$admin_expires = date("U") + 300;
incl... | true |
996237de559aa7be843c803dd9c7e6bced2a6258 | PHP | sarang4/FormMaker | /FBBundle/Controller/services/user.php | UTF-8 | 2,923 | 2.734375 | 3 | [] | no_license | <?php
function user_exist($email, $password, $conn, $logger){
try{
$user = $conn->fetchAssoc("SELECT * FROM fb_user WHERE email = ? and password = ?", array($email, $password));
if ($user){
return $user;
}
}catch(Exception $e){
$logger->err("Error in chcking user_exist " . $e);
throw $e;
}
re... | true |
09e1f43276fffbb411d456ec82f05707b40c773e | PHP | ZhangMin658/moodec-moodle | /classes/product_variable.php | UTF-8 | 2,308 | 2.796875 | 3 | [] | no_license | <?php
/**
* Moodec Variable Product
*
* @package local
* @subpackage local_moodec
* @author Thomas Threadgold
* @copyright 2015 LearningWorks Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// Load Moodle config
require_once dirname(__FILE__) . '/../../../config.php';
... | true |
6c4796d31dc42eb60806ae9bf549993bba03b8ed | PHP | marwaneahansal/laravel-ecommerce | /app/Models/Product.php | UTF-8 | 531 | 2.53125 | 3 | [] | no_license | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
use HasFactory;
protected $hidden = [
'created_at',
'updated_at'
];
protected $casts = [
'colors' => 'array',
'siz... | true |
344fda466915aa21464ba94eede654619628cf77 | PHP | jeremyb/techmeetups | /src/Infrastructure/ReadModel/Doctrine/DbalEventFinder.php | UTF-8 | 2,337 | 2.625 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace Infrastructure\ReadModel\Doctrine;
use Doctrine\DBAL\Connection;
use Domain\ReadModel\Event;
use Domain\ReadModel\EventFinder;
use Domain\ReadModel\Events;
final class DbalEventFinder implements EventFinder
{
/** @var Connection */
private $connection;
public fu... | true |
e55c093c5572d7664b7434a3fc31669ab3277a0e | PHP | Nathalieroussel/projet3 | /src/controler/backend/BackendController.php | UTF-8 | 2,193 | 2.515625 | 3 | [] | no_license | <?php
require_once('src/model/PostManager.php');
require_once('src/model/CommentManager.php');
class BackendController
{
public function listPostsAdmin()
{
$postManager = new PostManager();
$posts = $postManager->getPostsAdmin();
require('src/view/backend/listPostsAdmin.php');
}
public function newPostAdmin(... | true |
f16c596cee2d39ad1421a1d1097049e70bdcb457 | PHP | jengstro2/WP-MyClubWebAPI-ShowEventsWithTeamName | /myclubwebapi_get_events_with_team_name.php | ISO-8859-13 | 6,400 | 2.578125 | 3 | [] | no_license | <?php
// MyClub GetEvents shortcode
// shortcode [get_myclub_events_via_groupname url="https://<club>.myclub.fi/api/events/?group_id=" name="<Group/Team name>" amount="8"]
// Place Clubs Api Key into file: myclubapi.key (Api key can be asked and generated from http://myclub.fi support)
// NOTE! as the key can be used t... | true |
48a68da03222c4331337b376848413fda9f5a2b3 | PHP | laradium/laradium-documents | /src/Services/DocumentService.php | UTF-8 | 2,959 | 2.640625 | 3 | [] | no_license | <?php
namespace Laradium\Laradium\Documents\Services;
use Barryvdh\DomPDF\PDF;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Foundation\Application;
use Illuminate\Http\Response;
use Laradium\Laradium\Documents\Exceptions\MissingRelationException;
use Laradium\Laradium\Documents\Interfaces\DocumentableInte... | true |
3a20d007ccce1926f0df4b90ec396ecbab1e1e2d | PHP | ennshi/formulaire_classes | /register.php | UTF-8 | 3,074 | 2.78125 | 3 | [] | no_license | <?php
require_once 'core/init.php';
if(Input::exists()) {
if(Token::check(Input::get('token'))) {
$validate = new Validation();
$validation = $validate->check($_POST, array(
'username' => array(
'name' => 'Nom d\'utilisateur',
'required' => true,
'min' => 2,
'max' => 20,
'2letters_min' ... | true |
80c5eaffce14c89d78ab9111971941872a3ec92e | PHP | mirela68/pabd2014 | /src/Oprea Radu - Suteu Iacob/SecuritateSoftware/processFile.php | UTF-8 | 1,695 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
require_once "dependencies.php";
require_once 'lib/CUpload.php';
// TODO poate ar fi bine ca procesarea upload sa fie mutata într-un alt fisier
/**
* Procesare request
*/
$cipherIdentifier = CBrowser::getValueFromRequest("cipherAlgorithm");
$cipher = ACipher::getCipher($cipherIdent... | true |
ccb8a816fc27581e0dd4bf210a9a5de8a6faf946 | PHP | walace84/CelkePHP | /FullCalenderPDO/class/Usuario.php | UTF-8 | 4,162 | 2.96875 | 3 | [] | no_license | <?php
class Usuario {
private $idusuario;
private $deslogin;
private $dessenha;
private $dataCadastro;
public function getIdusuario()
{
return $this->idusuario;
}
public function setIdusuario($idusuario)
{
$this->idusuario = $idusuario;
}
public function ... | true |
4eed32af4d64ab78ac2bbb352e4fc7f008888e17 | PHP | fliglio/web | /test/Client/ClientTest.php | UTF-8 | 2,100 | 2.515625 | 3 | [] | no_license | <?php
namespace Fliglio\Web\Client;
use Fliglio\Http\Http;
class ClientTest extends \PHPUnit_Framework_TestCase {
public function testSuccess() {
$client = new BasicClient();
$b = new BasicRequestBuilder();
$req = $b
->method(Http::METHOD_GET)
->url('https://postman-echo.com/get')
->build();
$res... | true |
b5ebab13caa7930bc8952a1aacccd2ea051844cb | PHP | zeeklaar/CORALwww | /www/postTableJson.php | UTF-8 | 3,778 | 3.265625 | 3 | [] | no_license | <?php
/*
This script will return a set of json with the
data properly filtered
*/
if(!(isset($_GET["user"]) ))
{
echo "Missing User!";
die();
}
$username = $_GET["user"];
$categoryFilter = $_GET["categoryFilter"];
$siteFilter = $_GET["siteFilter"];
/*
Query the MySQL Databases to get the relevant da... | true |
90c2ae1bc99488fb5f6e05cd8457b4b9f3fdf913 | PHP | Daisuke-sama/the_clean_street_sym | /src/Twig/AppExtension.php | UTF-8 | 2,323 | 2.578125 | 3 | [] | no_license | <?php
namespace App\Twig;
use App\Service\MDHelper;
use Psr\Cache\InvalidArgumentException;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\ServiceSubscriberInterface;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
class AppExtensio... | true |
5dd9677bbe667a12820de2090830dc2326f8cdcc | PHP | raselrana1147/hms | /classes/Admin.php | UTF-8 | 9,959 | 2.6875 | 3 | [] | no_license |
<?php
$realpath=realpath(dirname(__FILE__));
include_once $realpath."/../lib/Database.php";
include_once $realpath."/../helper/Format.php";
?>
<?php
class Admin
{
private $db;
private $fm;
function __construct()
{
$this->db=new Database();
$this->fm=new Format();
}
public fu... | true |
63bd238f4b2e2137a2adcf9b18d5439181c6c418 | PHP | spapadem/spapadem.github.io | /scripts/menu.php | UTF-8 | 1,151 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
function return_page($get_variable)
{
if (isset($_GET[$get_variable]))
$return_page = htmlentities($_GET[$get_variable]);
else
$return_page= 'Home';
return $return_page;
}
function display_menu($page)
{
$menu_items = array("Home", "Research", "Software", "Films", "Contact");
ec... | true |
b0b09ab075daf2884ec07af2973f6682acb5eb60 | PHP | bmartin97/codeigniter4-recipe-blog | /app/Controllers/AddRecipe.php | UTF-8 | 1,950 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Controllers;
use App\Models\RecipesModel;
use App\Models\SessionModel;
use CodeIgniter\Controller;
class AddRecipe extends Controller
{
public function index()
{
helper('cookie');
$ci_session = get_cookie("ci_session");
if (isset($ci_session)) {
$sessio... | true |
fa8272626efc4da94298a5fa906e3173aff08a1f | PHP | skchel174/my-php-framework | /framework/Http/Client/Response/JsonResponse.php | UTF-8 | 693 | 2.578125 | 3 | [] | no_license | <?php
namespace Framework\Http\Client\Response;
use Framework\Http\Client\Stream\StreamFactory;
use Psr\Http\Message\StreamInterface;
class JsonResponse extends Response
{
public function __construct(mixed $body, int $statusCode = 200, string $reasonPhrase = '')
{
if ($body == null || $body instanceo... | true |
0db69afd73cc29cd04ccc4a4fcef482044dd842e | PHP | oJacker/gcversion | /backend/components/AGitCommit.php | UTF-8 | 4,168 | 3.171875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace backend\components;
use \yii\base\Component;
/**
* Represents a git commit.
*
* @author Charles Pick
* @author Jonas Girnatis <dermusterknabe@gmail.com>
* @package packages.git
*/
class AGitCommit extends Component {
/**
* The commit hash
* @var string
*/
public $hash;
/**
* The repo... | true |
1581d73c4bba53eac2800d0afea3313fcee4bd97 | PHP | lesstif/framework-1 | /src/Contracts/Commands/Component/Installer.php | UTF-8 | 489 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace LaravelZero\Framework\Contracts\Commands\Component;
/**
* This is the Laravel Zero Framework component install contract.
*
* @author Nuno Maduro <enunomaduro@gmail.com>
*/
interface Installer
{
/**
* Returns the component name.
*
* @return string
*/
public function getC... | true |
a13932b993cceb787dd007b338009fc9eb1f784b | PHP | PhPorkTraceability/PhPork---Web-Application | /inc/functions.php | UTF-8 | 78,591 | 2.734375 | 3 | [] | no_license |
<?php
require_once ('../inc/dbinfo.inc');
class phpork_functions
{
public function connect() {
/*
This function connects the web application to database.
*/
$link = mysqli_connect ( HOSTNAME, USERNAME, PASSWORD, DATABASE ) or die ( 'Could not connect: ' . mysqli_error () );
mysqli... | true |
47ce2fc3b56f2045ebed21e1d9c3308b5a3e33fd | PHP | Omnhio/symfony2-file-uploader-bundle | /Services/FileSystem.php | UTF-8 | 2,168 | 2.703125 | 3 | [] | no_license | <?php
/**
* Created by JetBrains PhpStorm.
* User: A140980
* Date: 14/11/12
* Time: 17:45
* To change this template use File | Settings | File Templates.
*/
namespace PunkAve\FileUploaderBundle\Services;
use Symfony\Component\Filesystem\Filesystem as BaseFileSystem;
class FileSystem extends BaseFileSystem
{
... | true |
b977175471bf4fce95f57a6d10d34949ffd68d6d | PHP | bdacode/site-freelances-v1.0 | /menu/services/menuServices.php | UTF-8 | 1,254 | 2.90625 | 3 | [] | no_license | <?php
include './sqlUtil/conexion.php';
/**
* @author freelances
*Clase para el manejo de los Menus
*/
class MenuServices{
/**
* Obtenemos los Menus de Cabeceras
* @return $dao Objeto PDO.
*/
static function getParentMenu($openSession){
// $openSession = null;
$consulta = 'select * from menline_parent o... | true |
59eba0c0d025750369c55c6dcc75d743fe26d043 | PHP | Torann/skosh-generator | /src/Content/Post.php | UTF-8 | 3,214 | 2.890625 | 3 | [
"BSD-2-Clause"
] | permissive | <?php
namespace Skosh\Content;
use Carbon\Carbon;
use Skosh\Builder;
use Symfony\Component\Finder\SplFileInfo;
class Post extends Content
{
public $category;
public $date;
public $excerpt;
public $image;
public $tags;
public $tag_class;
public $author = 'unknown';
/**
* Post con... | true |
cca7df66011fd979efa25038713d13ad29126667 | PHP | rdok/elasticemail-php | /src/Email/Email.php | UTF-8 | 592 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace ElasticEmail\Email;
use ElasticEmail\Client;
/**
* Access to Email API end points.
* @see http://api.elasticemail.com/public/help#Email_header
*/
class Email
{
/** @var Client */
private $client;
public function __construct(Client $client)
{
$this->client = $client;
}
... | true |