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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1d6fde60127d7df2ef78985cc2e6c99a6761c780 | PHP | andrzejenne/playlist | /app/Console/Commands/MediaManager.php | UTF-8 | 1,672 | 2.65625 | 3 | [] | no_license | <?php
namespace BBIT\Playlist\Console\Commands;
use BBIT\Playlist\Services\MediaManagerService;
use BBIT\Playlist\Services\WampClientService;
use BBIT\Playlist\Services\WampServerService;
use Illuminate\Console\Command;
use Illuminate\Foundation\Application;
use Thruway\ClientSession;
/**
* Class WampServer
* @pac... | true |
613b02c26c49d8380972df208df2d041d182b453 | PHP | hongker/Blog | /apps/core/operations/ConfigOperation.php | UTF-8 | 2,412 | 2.859375 | 3 | [] | no_license | <?php
namespace Blog\Operations;
use Blog\Models\Configs;
/**
* 系统配置操作类
* @author hongker
* @version 1.0
*/
class ConfigOperation extends BaseOperation implements Operation {
public function __construct($di) {
parent::__construct($di);
$this->setLogFile('config.log');
}
/** 配置信息
* @see \Blog\Operations\O... | true |
dcda1393c2388ce630c4094fbcae587512fb6a4d | PHP | ei17ringo/LaravelTest41 | /database/seeds/DatabaseSeeder.php | UTF-8 | 1,158 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
use Faker\Factory as Faker;
use Carbon\Carbon;
use App\Tweet;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard(); //マスアサイ... | true |
e0e4db6739e5385c98855d2d95aa45bc7bc3847f | PHP | izoya/PHP | /lesson5/dbconnect.php | UTF-8 | 392 | 2.734375 | 3 | [] | no_license | <?php
/**
* Осуществляет подключение в БД
* @return mysqli - объект БД
*/
function db() {
static $db;
if (!$db) {
$db = mysqli_connect('localhost', 'root', 'root', 'gallery');
if (mysqli_connect_errno()) {
echo "Не удалось подключиться к MySQL: " . mysqli_connect_error();
}
}
re... | true |
86985f927e9eec475b9e7743cca68f6eed860646 | PHP | imranertaza/DN-MLM | /app/Models/front_functions/student/std_functions.php | UTF-8 | 1,773 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
class std_functions extends CI_model {
public function show_products_by_catID($cat_id) {
$query = $this->db->query("SELECT * FROM `students` WHERE FIND_IN_SET(".$cat_id.", `cat_id`)");
if (mysql_num_rows($query)) {
while($product_query = mysql_fetch_array($query)) {
$std_id = $product_query['std_id'];... | true |
5b5cf0c7ea62a066177854ab517ed4331ac4f8c1 | PHP | JCquence/Clockwork | /system/core/Config.php | UTF-8 | 2,888 | 2.953125 | 3 | [] | no_license | <?php if(!defined('ACCESS')) exit('Access denied');
/**
* Config
* @author Jelle van der Coelen
* @package Clockwork/Core
*/
class Config extends Singleton
{
/**
* Holds loaded .ini file.
* @var array
*/
private $data = array();
/**
... | true |
e6ef14ab5c3784c9760ee80d6df5333ceae880e8 | PHP | LunarJim/LMSD2-NG | /content/themes/lmsdd/inc/custom-admin.php | UTF-8 | 1,430 | 2.71875 | 3 | [] | no_license | <?php
if ( is_admin() ) {
add_filter( 'dashboard_recent_posts_query_args', 'add_page_to_dashboard_activity' );
function add_page_to_dashboard_activity( $query_args ) {
if ( is_array( $query_args[ 'post_type' ] ) ) {
//Set yout post type
$query_args[ 'post_type' ][] = 'quote';
} else {
$temp = array( $qu... | true |
0bc344b1bd7e79e2c452aea8fb0eb11268c0f92d | PHP | WilsonKinyua/notes | /class/class_methods.php | UTF-8 | 198 | 3.40625 | 3 | [] | no_license | <?php
class Cars {
function greetings(){
}
function name(){
}
}
$my_methods = get_class_methods('Cars');
foreach($my_methods as $method){
echo $method . "<br>";
}
?> | true |
8e1457c4901d4ff4a7beccec3be2abea764c372f | PHP | 0x4a5k/razorpay-php | /src/Contact.php | UTF-8 | 1,361 | 2.71875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
namespace Razorpay\Api;
/**
* Class Contact
* @package Razorpay\Api
*
* @property string $id
* @property string $name
* @property string $contact
* @property string $email
* @property string $type
* @property string $reference_id
* @property mixed $batch_id
* @property bool $active
* @property a... | true |
d05b2b078c32d92e63fdbfa449c0e6cb8b8d9546 | PHP | ipv6china/csvn | /install/dbconv.php | UTF-8 | 2,433 | 2.546875 | 3 | [] | no_license | #!/usr/bin/php
<?php
if($argc !=3 && in_array($argv[1],array('-pass', '-auth'))){
print <<<EOT
Usage:
$argv[0] <-pass|-auth> filename
EOT;
} else{
//转换账户
if($argv[1]=='-pass'){
$fd=fopen($argv[2],'rb');
if($fd){
$content='';
$line='';
//循环读
while(!feof($fd)){
$_line=fgets($fd,4096);
... | true |
0fa38f6126d27de437728f39f84594ad9e02a584 | PHP | Inam-ul-haq/rc-rainbow-unicorn-lucifer_phpunit_testapi | /database/seeds/VouchersSeeder.php | UTF-8 | 2,164 | 2.671875 | 3 | [] | no_license | <?php
use Illuminate\Database\Seeder;
use Faker\Factory as Faker;
// @codingStandardsIgnoreLine
class VouchersSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
factory(App\Voucher::class, 10)->create();
/*
* Seed some product re... | true |
ec6bdc2715447c1f65b3d841ae8d4f1e3e38803a | PHP | HenryVolkmer/symfony-assetpublisher | /src/AssetClearer.php | UTF-8 | 2,071 | 2.671875 | 3 | [] | no_license | <?php
namespace Henry\AssetPublisherBundle;
use Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Exception\IOException;
use array_key_exists;
class AssetClearer implements CacheClearerInterface
{
private array $assets =... | true |
57dc6450c8215364159e03222cc0879394dd5fda | PHP | rajat5225/lincollc | /application/models/Dropbox_model.php | UTF-8 | 6,607 | 2.640625 | 3 | [] | no_license | <?php
class Dropbox_model extends CI_Model {
public
function __construct() {
parent::__construct();
}
public
function getformat( $strpos ) {
if ( $strpos == "folder" ) {
return "folder";
}
if ( $strpos == "application/msword" || $strpos == "application/vnd.openxmlformats-officedocument.wordprocessingm... | true |
0267b739a6242c7c6e03601f4960c7da3ed8a7b7 | PHP | szatrio/employee_web | /app/Http/Controllers/SessionController.php | UTF-8 | 708 | 2.921875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class SessionController extends Controller
{
// menampilkan isi session
public function index(Request $request) {
if($request->session()->has('name')){
echo $request->session()->get('name');
}else{
echo 'Tidak ada data nama dalam sessi... | true |
bbb3a4bde1b446c483c95cd5702467eba1a804af | PHP | santowise/rjvedacoes | /cotacao/lib/utilidades.php | UTF-8 | 26,138 | 3.53125 | 4 | [] | no_license | <?php
class Utilidades
{
/**
* Formata CPF com apenas números para o formato
* padrao: 111.222.333-11
*
* @param: $cpf_numerico
**/
public static function formataCPF($cpf_numerico)
{
//Separa dados
$parte1 = substr($cpf_numerico, 0, 3);
$parte2 = substr... | true |
a4828749247e260b50364e474830636f13d78014 | PHP | anabeto93/Laravel-and-Flutter-News | /app/Http/Controllers/Shared/BaseTagController.php | UTF-8 | 946 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Shared;
use App\DTO\TagData;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Repositories\Tag\TagInterface;
use App\Http\Controllers\Shared\Interfaces\ShowResourceInterface;
use App\Http\Controllers\Shared\Interfaces\IndexResourceInterface;
use App\Http\C... | true |
9773ebc67a42d0c56a9b371e5ef7201634ef2cc0 | PHP | Nathan-str/ProjetAvril | /Projet Avril/professeur/include/fonction.php | UTF-8 | 5,000 | 3.109375 | 3 | [] | no_license | <?php
//Fonction permettant d'afficher le message souhaité pour le numéro d'erreur indiqué
//Fonction utilisé sur les pages de redirection.
function error($numero, $message){
if(isset($_GET['error'])){
if($_GET['error'] == $numero){
?>
<script type="text/javascript">
alert("<?php echo($message);?>");... | true |
55adf1ad676a559d0964efd930c32352c78e4863 | PHP | IndustrialDragonfly/DEdC | /Interface/associativeArrayManager.php | UTF-8 | 7,409 | 2.9375 | 3 | [] | no_license | <?php
/*
* This PHP library is responsible for performing generic management tasks
* on the associative arrays used by request/response objects.
*/
/**
* For the input associative array, adds the UUID tag to relavent fields based
* on its genericType attribute.
* @param Mixed[] $rawData
* @param String $tag
... | true |
ea392002a81edd630ef07ccf3705fe76fbf6afd4 | PHP | BrunoRB/flow | /code/core/install/installcontroller.php | UTF-8 | 3,484 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace core\install;
use core\install\Examples;
use src\enum\Table;
class InstallController {
public function install() {
$this->cleanDatabase();
//TODO install DATABASE
$this->createTestUser();
$this->installExamples();
\RedBean_Facade::close();
}
p... | true |
a30df7b435b73a2fa72b09738bee44e6dba11f0b | PHP | MAlifiahM/taskChallange | /app/Services/AlbumService.php | UTF-8 | 1,089 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Services;
use App\Album;
use Illuminate\Http\Request;
class AlbumService{
public function getAllAlbums(){
$albums = Album::all()->toArray();
return response()->json($albums);
}
public function createNewAlbum(Request $request){
$album = $request->all();
... | true |
d11d27e7947810858a35cf33bdac749c4b79fa04 | PHP | FrancoisFoerster/Calories | /fromunity.php | UTF-8 | 341 | 2.6875 | 3 | [] | no_license | <?php
$text1 = $_POST["name"];
$text2 = $_POST["data"];
if ($text1 != "") {
echo("Message sent!");
echod("Field 1:". $text1);
echod("Field 2:". $text2);
$file = fopen("test.txt", "a");
swrite($file, $text1);
swrite($file, $text2);
fclose($file);
} else {
echo("Message delivery ... | true |
4ce145e8436171ad91df41085f0d2416f86eb854 | PHP | dypatrick/Cybersecurity_Assessment_Tool | /public/quizresult/index.php | UTF-8 | 3,427 | 2.625 | 3 | [] | no_license | <?php
header('Access-Control-Allow-Origin: *');
date_default_timezone_set("America/New_York");
// $servername = "localhost";
// $username = "root";
// $password = "";
// $database = "sdbc";
// $conn = new mysqli($servername, $username, $password, $database);
$conn = new PDO('sqlite:D:\... | true |
50bd6a098ef0e9740401728a6d06e62372581dbf | PHP | ciaranmcnulty/releasr | /tests/unit/classes/Controller/ReviewerTest.php | UTF-8 | 3,493 | 2.515625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/**
* @package Releasr
*/
class Releasr_Controller_ReviewerTest extends PHPUnit_Framework_Testcase
{
/**
* @var Releasr_Controller_Lister
*/
private $_lister;
/**
* @var Releasr_Controller_Reviewer
*/
private $_reviewer;
/**
* @var Releasr_SvnRunner
*/
p... | true |
2bbaeeee85d7f6c66fffc20b3a647ce33550f7fe | PHP | MahfuzaJui/WebTech_Final | /Final Project/controller/Search.php | UTF-8 | 821 | 2.53125 | 3 | [] | no_license | <?php
session_start();
if (!isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == false) {
header("Location: index.php");
}
if ($_SESSION['type'] != 'Admin') {
header("Location: logout.php");
}
require_once "controller/HouseController.php";
$area = array("Bashundhara R/A", "Kuratoli", "Nikunjo");
$house... | true |
205ff740d4a11ef50ec17b562162eccc451dc073 | PHP | im286er/MyThink | /Core/Common/Functions/filter.php | UTF-8 | 447 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | <?php
/**
* 过滤器方法 引用传值
* @param string $name 过滤器名称
* @param string $content 要过滤的内容
* @return void
*/
function filter($name, &$content) {
$class = $name . 'Filter';
$filter = ThinkInstance::Filter($name);
$content = $filter->run($content);
}
// 过滤表单中的表达式
function filter_exp(&$value){
if (in... | true |
033da3a2f8b80d539e8ffa136f9f83ca447c5925 | PHP | Sam-Burns/table-data-gateway | /tests/phpunit/SamBurns/TableDataGateway/Test/AbstractMapperTest.php | UTF-8 | 2,427 | 2.625 | 3 | [] | no_license | <?php
namespace SamBurns\TableDataGateway\Test;
use SamBurns\TableDataGateway\Test\Fixtures\ExampleConcreteTableGateway;
use SamBurns\TableDataGateway\Test\Fixtures\ExampleConcreteMapper;
use SamBurns\TableDataGateway\Test\Fixtures\ExampleModel;
use PHPUnit_Framework_MockObject_MockObject as Mock;
use PHPUnit_Framewor... | true |
b27b1977af145bde09b642062e2c342e09aff029 | PHP | nadasallah/Nada-Salah-Sun-1 | /5.php | UTF-8 | 278 | 3.765625 | 4 | [] | no_license |
<?php
/*5-write a script that removes any duplicates from an array. */
$input = array(4, "4", "3", 4, 3, "3");
$result = array_unique($input);
var_dump($result);
echo "<br>";
//anther solution
$a=array("a"=>"red","b"=>"green","c"=>"red");
print_r(array_unique($a));
?>
| true |
f15a7404ef5ff40699958d8452d1bf72bd75c941 | PHP | poojakarthik/my-work | /html/admin/classes/application/handler/Application_Handler_Report.php | UTF-8 | 1,749 | 2.609375 | 3 | [] | no_license | <?php
class Application_Handler_Report extends Application_Handler {
const TEMPORARY_DIRECTORY = "temp/";
// Manage Reports: List of reports with privilege to configure, schedule, and run as per their PERMISSION Level
public function Manage($subPath) {
// Check user permissions
AuthenticatedUser()->PermissionOr... | true |
9e290802c09ffc01aef21faf5442a481c10491a0 | PHP | mattiellojr/immtradersclub | /application/controllers/Examples.php | UTF-8 | 19,099 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
defined('BASEPATH') or exit('No direct script access allowed');
/**
* Community Auth - Examples Controller
*
* Community Auth is an open source authentication application for CodeIgniter 3
*
* @package Community Auth
* @author Robert B Gottier
* @copyright Copyright (c) 2011 - 2018, R... | true |
bf671778fb6d3498eb1162b7afdb7d843a20751e | PHP | raymundogab7/bgywifi | /app/Modules/UserRoles/Repository/EloquentUserRolesRepository.php | UTF-8 | 640 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
namespace BrngyWiFi\Modules\UserRoles\Repository;
use BrngyWiFi\Modules\UserRoles\Models\UserRoles;
class EloquentUserRolesRepository implements UserRolesRepositoryInterface
{
/**
* @var UserRoles
*/
private $userRoles;
/**
* @param UserRoles
*/
public function __construct(... | true |
4b34612e1283fdb70f83f5fe8fffd9a0826a274a | PHP | nancologist/php_mvc | /app/oop/part2_4.php | UTF-8 | 415 | 3.265625 | 3 | [] | no_license | <?php
//declare(strict_types = 1);
class User {
public string $username;
public static int $minPassLength = 6;
public static function validatePass($pass): void {
if(strlen($pass) >= self::$minPassLength) {
echo "Password is valid.";
} else {
echo "<p style='color: r... | true |
7a9ecebfb5cb2af2dee9a98ef10d043e4e67a6ce | PHP | Ratuvog/fitpark.ru | /application/migrations/006_add_table_coach.php | UTF-8 | 1,425 | 2.515625 | 3 | [] | no_license | <?php defined('BASEPATH') OR exit('No direct script access allowed');
class Migration_add_table_coach extends CI_Migration
{
public function up()
{
//Структура таблицы `coach`
$this->db->query("
CREATE TABLE IF NOT EXISTS `coach` (
`id` int(11) NOT NULL AUTO_INCREMENT,... | true |
532f0117ce85318340f447077456d7f1caeec7a6 | PHP | haideridris/InternetTechnologiesCW | /includes/deleteproduct.inc.php | UTF-8 | 1,911 | 3.03125 | 3 | [] | no_license | <?php
//Check to see if this php script has run because of the admin clicking the delete button on the delete product form and not by typing in the url for this webpage
if (isset($_POST['deleteproduct-submit'])) {
//Now we have access to our database using the variable $conn found within the dbh.inc.php file
requir... | true |
88e06d95167982a94d743a83dbd3e6d4df8797d6 | PHP | quebone/infojor | /presentation/model/EvaluationViewModel.php | UTF-8 | 6,493 | 2.703125 | 3 | [] | no_license | <?php
namespace infojor\presentation\model;
use infojor\service\DAO;
use infojor\service\EvaluationService;
use infojor\service\SchoolService;
final class EvaluationViewModel extends MainViewModel {
public function __construct() {
parent::__construct();
}
private function getPartialEvaluationDescriptions():ar... | true |
1e66dc520e15963ae723619e0f87189f6e148b40 | PHP | terravoz/voxbox | /profiles/voxbox/modules/contrib/install_profile_api/contrib/themekey.inc | UTF-8 | 614 | 2.59375 | 3 | [] | no_license | <?php
/**
* Add a new themekey path.
*
* @param $path
* Drupal path where this theme should be used.
* @param $theme
* The theme to switch to.
*/
function install_themekey_add_path($path, $theme, $fit = 1, $weight = 0, $wildcards = array(), $conditions = array(), $custom = 1, $callbacks = array()) {
db_... | true |
14ad98ae1f3a871de0f5e04cc5b86fc0970e3a0f | PHP | 40uf411/mivo | /src/services/Timer/Time.php | UTF-8 | 6,845 | 3.21875 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace Luna\services\Timer;
class Time
{
private $year = 0;
private $month = 0;
private $day = 0;
private $dow = 0;
private $hour = 0;
private $minute = 0;
private $second = 0;
private static function treat_day(?string $day)
{
switch ($day)
{
... | true |
f10c30c33425aa1ae22c5efd8bce1e1e27a7dd85 | PHP | marc0venicio/portifolio-laravel-vue | /site/app/Http/Controllers/ContactForm.php | UTF-8 | 919 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use App\Mail\SendMail;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;
class ContactForm extends Controller
{
private $name;
private $last_name;
private $telephone;
private $email;
private $message;
public function __construct(Request ... | true |
1257ee15e40855474fcbb50c073e558f264e9f75 | PHP | allexirlley/php-picpay | /src/Suport/Payload/Notification.php | UTF-8 | 1,392 | 3.015625 | 3 | [] | no_license | <?php
namespace PhpPicPay\Suport\Payload;
use PhpPicPay\Notification\NotificationPayloadInterface;
class Notification implements NotificationPayloadInterface
{
/**
* @var string
*/
private $referenceId;
/**
* @var string
*/
private $authorizationId;
public static function par... | true |
3153f25de996616544349ecf94e03ad5a11ceb02 | PHP | achursin/Tasks_for_PHP | /Task_correct/index_numbers.php | UTF-8 | 1,335 | 3.21875 | 3 | [] | no_license | <?php
// Правильные:
$correctNumbers = [
'84951234567', '+74951234567', '8-495-1-234-567',
' 8 (8122) 56-56-56', '8-911-1234567', '8 (911) 12 345 67',
'8-911 12 345 67', '8 (911) - 123 - 45 - 67', '+ 7 999 123 4567',
'8 ( 999 ) 1234567', '8 999 123 4567'
];
// Неправильные:
$incorrectNumbers = [
'02',... | true |
5828d52c593c0aff1b8586a529b7cb8888a91c14 | PHP | aggreyshad/scas | /add_mark_process.php | UTF-8 | 3,041 | 2.640625 | 3 | [] | no_license | <?php
if(isset($_POST['add_new_mark']))
{
$student_id = $_POST['student_id'];
$subject_id = $_POST['subject_id']; //o level subject to be inserted
$aggregate_id = trim($_POST['aggregate_id']);
$exam_id=4; //UCE UNEB
$year_of_exam=2014;
$term=3;
$class_id = $_POST['class_id'];
$class_id = 4; //NB UCE ... | true |
4beea6a44fa497516a64f2b4f6a1904454b7433a | PHP | LaziestMan/Online-Voting-System | /express_modules/ORM/ORM.php | UTF-8 | 3,956 | 3.140625 | 3 | [
"MIT"
] | permissive | <?php
/**
* ORM Module class definition
*/
class ORM {
public $db;
protected $dbName;
/**
* Method connects to MySQL database
* @param string $servername
* @param string $username
* @param string $password
* @param string $db
*/
public function connect($servername, $username, $pas... | true |
327c425e7d4bab12bd712a5f4756ecf72f866284 | PHP | f0rk/project-euler | /php/problem19.php | UTF-8 | 1,475 | 3.59375 | 4 | [
"MIT"
] | permissive | <?php
//solution: 171
echo eulerProblem19() . "\n";
function eulerProblem19() {
$daysInMonths = array(31,28,31,30,31,30,31,31,30,31,30,31);
$dayOfWeek = "tuesday";
$sundaysOnFirst = 0;
for($year = 1901; $year <= 2000; ++$year) {
for($month = 0; $month < 12; ++$month) {
... | true |
162ed74d9831bee8ee3a723c5ab78f9f018070f2 | PHP | greggameplayer/ppeDEVSymfonyV2 | /src/Repository/StaffRepository.php | UTF-8 | 1,946 | 2.578125 | 3 | [] | no_license | <?php
namespace App\Repository;
use App\Entity\Staff;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
use Symfony... | true |
15eb38c58ba2fdb403c2a37a122d51ba86bdd3a3 | PHP | RhubarbPHP/Module.Stem | /tests/unit/Models/Validation/EqualToTest.php | UTF-8 | 1,096 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace Rhubarb\Stem\Tests\unit\Models\Validation;
use Rhubarb\Crown\Tests\Fixtures\TestCases\RhubarbTestCase;
use Rhubarb\Stem\Exceptions\ModelConsistencyValidationException;
use Rhubarb\Stem\Models\Validation\EqualTo;
use Rhubarb\Stem\Tests\unit\Fixtures\User;
class EqualToTest extends RhubarbTestCase
{
... | true |
e40479b687e87eb67d5f0f9b101c186f2565b5c7 | PHP | buzz8year/bee | /src/models/Task.php | UTF-8 | 7,323 | 2.890625 | 3 | [] | no_license | <?php
namespace models;
use db\Querier;
// EXPLAIN: Soft Dependency Injection /
// method(... , \PDO $pdo = null) /
// down here in this class is used /
// for future unit testing purposes
class Task
{
// EXPLAIN: ...
const STATUS_COMPLETED = 2;
const SORT_DEFAULT = 'id';
protected $id;
prote... | true |
cd2d4deac45fc02e7d8213839bb1b01a353056be | PHP | jorgepc78/uninova_ionic_app | /uninova_api/recupera.php | UTF-8 | 3,215 | 2.609375 | 3 | [] | no_license | <?php
require_once("parametros.php");
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
error_log("Connection failed: " . $conn->connect_error);
}
//error_log(print_r($_REQUEST,1));
$email = mysqli_real_escape_string($c... | true |
3c4570f4c452acfee581946784f13a2670bc7ba0 | PHP | sangse0911/caption-project | /app/Services/UserService.php | UTF-8 | 1,955 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Services;
use App\Interfaces\UserInterface;
use App\Models\User;
class UserService implements UserInterface
{
/**
* [getAll description]
* @return [type] [description]
*/
public function getAll()
{
$users = User::paginate(20);
return $users;
}
... | true |
c299e50d7afdb36143c04235068d9cd3ed7f1c88 | PHP | Nycto/phpVocab | /src/classes/Parser/Object/Signature.php | UTF-8 | 3,847 | 2.890625 | 3 | [] | no_license | <?php
/**
* @license Artistic License 2.0
*
* This file is part of phpVocab.
*
* phpVocab is free software: you can redistribute it and/or modify
* it under the terms of the Artistic License as published by
* the Open Source Initiative, either version 2.0 of the License, or
* (at your option) any later version.... | true |
9209dd209aedd8d29dd65f8bc49bbf153053083b | PHP | elden43/advent2019 | /app/Presenters/Day2Presenter.php | UTF-8 | 1,811 | 3.046875 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace App\Presenters;
final class Day2Presenter extends BasePresenter
{
/** @var array $program */
private $program;
public function renderPuzzleResult(): void {
$this->template->firstPuzzleResult = $this->firstPuzzleResult();
$this->template->secondPuzzleResult = $this->s... | true |
8769d50b9208f03b09ba85822924f9febdeaaed1 | PHP | juxtamor/fiestaloca | /models/Command.class.php | UTF-8 | 3,046 | 3.046875 | 3 | [] | no_license | <?php
class Command
{
// liste des propriétés -> privées
private $id;
private $status;
private $id_user;
private $total_price;
//PROPRIETES CALCULEE
private $user;
private $products;
//PROPRIETE TRANSMISE
private $db;
public function __construct($db)
{
$this->db = $db;
}
public function getId()
... | true |
680cd6f32036ef9131ae70da9b4f4390086656af | PHP | vimeo/psalm | /src/Psalm/Internal/Analyzer/AlgebraAnalyzer.php | UTF-8 | 5,083 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
namespace Psalm\Internal\Analyzer;
use PhpParser;
use Psalm\CodeLocation;
use Psalm\Exception\ComplicatedExpressionException;
use Psalm\Internal\Algebra;
use Psalm\Internal\Clause;
use Psalm\Issue\ParadoxicalCondition;
use Psalm\Issue\RedundantCondition;
use Psalm\IssueBuffer;
use Psalm\Storage\Assertion\InArra... | true |
7f1285d632eb385861dcaabf8ba67fbffc8dd8ea | PHP | andreferreira-me/curso-em-video-php | /ola.php | UTF-8 | 309 | 3.015625 | 3 | [] | no_license | <!doctype html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<title>Primeiro Exemplo - PHP</title>
</head>
<body>
<h1>Testando PHP</h1>
<?php
echo "<h2>Olá,<br />Mundo!</h2>";
$idade = 3;
$sal = 1825.54;
$nome = "Leonardo";
$casado = false;
?>
</body>
</html>
| true |
0c23ed0a874777e4cb9d0aed74b4139678ce9418 | PHP | reinartb/fitl-app-basic | /request-controller.php | UTF-8 | 1,250 | 2.9375 | 3 | [] | no_license | <?php
$page = $_REQUEST['page'];
$servername = 'localhost';
$username = 'root';
$password = '';
// Create connection.
$conn = new mysqli($servername, $username, $password);
// Check if connection is valid.
if($conn->connect_error) {
echo 'Connection Failed: ' . $conn->connect_error;
exit;
}
echo 'Connected Su... | true |
f9873eba5a7064c5067bc550aa77bedcf33f6ce6 | PHP | bugloos/responder-bundle | /src/Service/Paginator.php | UTF-8 | 3,272 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace Bugloos\ResponderBundle\Service;
use Bugloos\ResponderBundle\PaginatorHandler\Contract\PaginatorHandlerInterface;
use Symfony\Component\HttpFoundation\Request;
use Doctrine\ORM\QueryBuilder;
use Doctrine\ORM\Query;
/**
* @author Mojtaba Gheytasi <mjgheytasi@gmail.com>
*/
class Paginator
{
priva... | true |
c1b11356f7fa7f80a66c42e7ced434ef34344f93 | PHP | Hopsaheysa/Final_project_food_map | /web/app/Models/User.php | UTF-8 | 1,664 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use App\Models\Recipe;
use App\Models\Rating;
use App\Models\Ingredient;
use App\Models\Com... | true |
3bb63d867c5556fa5bbd83129e4cb97f06ec7721 | PHP | hymedbsk/TFE_2019-2020 | /app/Http/Middleware/Membre.php | UTF-8 | 520 | 2.5625 | 3 | [] | no_license | <?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Closure;
use Illuminate\Http\RedirectResponse;
use Auth;
class Membre
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
... | true |
e73b9430e10bf34ebdedf27e4ebad017e59c7006 | PHP | tmsnvd/newtimelist | /protected/components/UserIdentity.php | UTF-8 | 2,438 | 2.8125 | 3 | [] | no_license | <?php
/**
* UserIdentity represents the data needed to identity a user.
* It contains the authentication method that checks if the provided
* data can identity the user.
*/
class UserIdentity extends CUserIdentity
{
private $_id;
/**
* Authenticates a user.
* The example implementation makes sur... | true |
d28ac0f4f2fdb8e7fc7e61ddcf8467274810c704 | PHP | koyolgecen/maj-mad-app | /src/DataFixtures/DModeleFixture.php | UTF-8 | 2,794 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\DataFixtures;
use App\Entity\CCTP;
use App\Entity\Composant;
use App\Entity\CoupeDePrincipe;
use App\Entity\Modele;
use App\Entity\Module;
use Doctrine\Persistence\ObjectManager;
class DModeleFixture extends BaseFixture
{
/**
* @param ObjectManager $manager
*/
protected function... | true |
07b685a9f988f8b343a1ce5137135a5c4c128c3e | PHP | CristianD1/The_Scoreboard | /site/php/userAccountInfo.php | UTF-8 | 3,556 | 2.75 | 3 | [] | no_license | <?php
include 'conn.php';
$db = new Db();
$userID = intval($_SESSION['personID']);
// Get user info
$playerInfo = $db->select("SELECT FirstName, LastName, AboutMe FROM Persons WHERE PersonID = ".$userID.";");
$playerInfoRetval = Array(
'firstName' => $playerInfo[0]['FirstName'],
'lastName' => $playerInfo[0... | true |
d58f84da80b71c6aee43a8529104792cd207a609 | PHP | Pencioner/tnetv | /server_root/singleton_trait.php | UTF-8 | 536 | 2.96875 | 3 | [] | no_license | <?php
trait Singleton
{
protected static $instance;
final public static function getInstance()
{
if (!isset(static::$instance)) {
static::$instance = new static;
$init_args = func_get_args();
call_user_func_array(array(static::$instance, '_init'), $init_args);
... | true |
64a591290eaf35743288f16d35ab7ac158ff993c | PHP | zhangqiquan/zhanshop-framework | /src/zhanshop/console/command/software/ScanPorts.php | UTF-8 | 4,501 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | <?php
// +----------------------------------------------------------------------
// | zhanshop / ScanPorts.php [ 2023/8/3 上午9:05 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2023 zhangqiquan All rights reserved.
// +---------------------------------------------... | true |
e21cce0e06431617ab362e551388c6d5bd405e25 | PHP | zaratedev/laravel8-crud | /app/Models/Traits/Presentable.php | UTF-8 | 1,153 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models\Traits;
use App\Models\Presenters\Presenter;
use Exception;
use Illuminate\Container\Container;
trait Presentable
{
/**
* View presenter instance.
*
* @var mixed
*/
protected $presenterInstance;
/**
* Prepare a new or cached presenter instance.
*
... | true |
c0c024fea9f028560bec5defdc1e1df55ab54a54 | PHP | Nono-naud/Php-fondamentaux | /cercle.php | UTF-8 | 217 | 3.265625 | 3 | [] | no_license | <?php
define("PI",3.14);
$rayon=6;
$perimetre=2*PI*$rayon;
$surface=pow($rayon,2)*PI;
echo "Le périmétre du cercle est ". $perimetre; echo "<br>";
echo "La surface du cercle est ". $surface; echo "<br>";
?> | true |
c58b334d2d0d2a88846a73b5e12e26c4d1da39ff | PHP | julianseymour/php-web-application-framework | /src/admin/AdminValidator.php | UTF-8 | 813 | 2.578125 | 3 | [] | no_license | <?php
namespace JulianSeymour\PHPWebApplicationFramework\admin;
use function JulianSeymour\PHPWebApplicationFramework\user;
use JulianSeymour\PHPWebApplicationFramework\security\xsrf\AntiXsrfTokenValidator;
use JulianSeymour\PHPWebApplicationFramework\validate\Validator;
class AdminValidator extends Validator
{
pub... | true |
451226f56f71d37e1adcf5274675c9bea918f19d | PHP | jeslopcru/qashops | /src/Exceptions/FileIsEmptyException.php | UTF-8 | 241 | 2.96875 | 3 | [] | no_license | <?php
namespace Exceptions;
use Exception;
class FileIsEmptyException extends Exception
{
public function __construct($path) {
$message = sprintf('The file <%s> is empty', $path);
parent::__construct($message);
}
} | true |
c6ba0ab9677c4dd666fd4f817208dfca23781c3b | PHP | sachin84tyagi/bookm | /admin/video-uploader.php | UTF-8 | 3,542 | 2.53125 | 3 | [] | no_license | <?php
/*-------------------------------------------
| Created By: Raj Deo
| Date: 19-07-2011
| Description: This script is used to upload image.
--------------------------------------------*/
session_start();
include_once("../codelibrary/inc/variables.php");
//creating database objet
$obj= new database_class();
$fun... | true |
6a3fe5a54fadd923b6b435d48827c1854122b350 | PHP | TylerJang27/NetworkSpeedProcessing | /config.php | UTF-8 | 735 | 2.609375 | 3 | [] | no_license | $reading = fopen('D:\Documents D\DUKEDEVILS\Code+\PracticeCoding\data.txt', 'r');
$writing = fopen('D:\Documents D\DUKEDEVILS\Code+\PracticeCoding\data.txt.tmp', 'w');
$replaced = false;
while (!feof($reading)) {
$line = fgets($reading);
if (stristr($line,'word')) {
$line = "word=\"new word\"\n"... | true |
49688f433dff82687dbd7a60ff20b5396dca81a3 | PHP | Bloafer/dust-php | /src/Dust/Ast/BodyList.php | UTF-8 | 263 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
namespace Dust\Ast;
class BodyList extends Ast {
public $key;
public $body;
public function __toString() {
$str = '{:' . $this->key . '}';
if ($this->body != null) $str .= $this->body;
return $str;
}
} | true |
ece1162241cc3e5ae553d7376cba7fbe1b24c110 | PHP | niphoenixo/OpenTracker | /trackersendmail.php | UTF-8 | 1,367 | 2.6875 | 3 | [] | no_license | <?php
/*-- sendmail.php --*/
ini_set('display_errors',1);
ini_set('display_startup_errors',1);
error_reporting(-1);
require_once('classes/Email.php');
require_once('classes/Courier.php');
$id = rand(111, 999);
$id.=rand(111, 999);
// construct the email
$Email = new Email();
//You can use HTML form for below stat... | true |
fd1d2b528ac58381d000d6b2f6de122899723101 | PHP | amityaharoni/MyDataLaboratory | /src/MyDataLab/Bundle/UserBundle/Entity/User.php | UTF-8 | 3,983 | 2.640625 | 3 | [] | no_license | <?php
namespace MyDataLab\Bundle\UserBundle\Entity;
use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use MyDataLab\Bundle\RetailersBundle\Entity\Retailer;
use MyDataLab\Bundle\AlertsBundle\Entity\Alert;
/**
* User
*/
class User ... | true |
7a1e8ff5d05b759fe5113660daa3dd9ed8695dd3 | PHP | saschati/yii2-value-object | /src/Types/Flats/IntegerType.php | UTF-8 | 741 | 3.09375 | 3 | [
"MIT"
] | permissive | <?php
/**
* PHP version 8.1
*
* @package Saschati\ValueObject\Types\Specials
*/
namespace Saschati\ValueObject\Types\Flats;
use Saschati\ValueObject\Types\Flats\Interfaces\FlatInterface;
/**
* Class IntegerType
*
* Converting a value to an int.
*/
class IntegerType implements FlatInterface
{
/**
* @... | true |
4b7c57460fce8a8a80a3a9cecf5e5717f1ba88af | PHP | joaquinmike/open.poi | /module/Auth/src/Auth/Model/AuthRolRecurso.php | UTF-8 | 1,330 | 2.671875 | 3 | [] | no_license | <?php
/**
* Currency db AuthRolRecurso
*
* @author joaquinmike
*/
namespace Auth\Model;
use Util\Model\Repository\Base\AbstractRepository;
class AuthRolRecurso extends AbstractRepository {
/**
* @var String Name of db table
*/
protected $_table = 'auth_rol_recurso';
/**
* @var Adap... | true |
a73e47e2073d44a44c0d18c5662adcffb550cf1d | PHP | isurudilhansenanayaka/Farm-Management-System-IOT | /print_invoice.php | UTF-8 | 2,442 | 2.546875 | 3 | [] | no_license | <?php
//print_invoice.php
if(isset($_GET["pdf"]) && isset($_GET["id"]))
{
require_once 'pdf.php';
include('database_connection.php');
$output = '';
$statement = $connect->prepare("
SELECT * FROM tbl_order
WHERE order_id = :order_id
LIMIT 1
");
$statement->execute(
array(
':order_id' => $_GET["i... | true |
47f1f5d9e8571a95dba42a7ea9640342c2599a6a | PHP | CMYKpixels/PHP-Objet | /Exercises/forum/model/sessionManager.php | UTF-8 | 202 | 2.671875 | 3 | [] | no_license | <?php
function setMessage(){
$_SESSION['user']['success'] = 'Nouvel Utilisateur créé avec succès !';
}
function setUserSessionLogin($user){
$_SESSION['user']=$user;
} | true |
5fed56cb4ae4dfe0b739f502cc7021da06d2c253 | PHP | ariezncahyo/AplikasiWebProfilKelurahan | /php/bukutamu/isi.php | UTF-8 | 1,144 | 2.625 | 3 | [] | no_license | <?php
mysql_connect("localhost","root","danger");
mysql_select_db("bukutamu");
$query = "SELECT * FROM guestbook ORDER BY id DESC";
$hasil = mysql_query($query);
while($data = mysql_fetch_array($hasil))
{
$komentar = $data['komentar'];
$komentar = str_replace(":-)", "<img src=\"smiley/1.gif\">", $komentar);
$komentar... | true |
bd5a0d96d0efcd39a1438560c8f574fd027e53b2 | PHP | albertomatos/projeto-PHP | /orcamento/processamento.php | UTF-8 | 477 | 2.671875 | 3 | [] | no_license | <?php
include_once 'Orcamento.php';
$orcamento = new Orcamento();
switch ($_GET['acao']) {
case 'salvar';
# Se o id não estiver vazio ele altera, senão ele cria um novo.
if (!empty($_POST['id_orcamento'])) {
$orcamento->alterar($_POST);
} else {
$orcamento->inserir(... | true |
07a76561b7bdc0bf49511c67754140af9fe1fe24 | PHP | Maxistr1/dynamicus | /src/Audicus/Middleware/AddEntityToStorageMiddleware.php | UTF-8 | 3,676 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace Audicus\Middleware;
use Common\Entity\DataObject;
use Common\Middleware\ConstantMiddlewareInterface;
use Common\Middleware\GenerateKeyTrait;
use Interop\Http\ServerMiddleware\DelegateInterface;
use Interop\Http\ServerMiddleware\MiddlewareInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\... | true |
4032719de52814376771897be66ac1d56f0b2135 | PHP | phpkata/phpkata | /src/Core/Model/Message.php | UTF-8 | 168 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php declare(strict_types=1);
namespace Star\PHPKata\Core\Model;
interface Message
{
/**
* @return string
*/
public function toString(): string;
}
| true |
0f30795416c1f71bb236eb22f690aefdb74e807d | PHP | ardiqghenatya/koptel2 | /app/Helpers/VoucherHelper.php | UTF-8 | 2,198 | 2.765625 | 3 | [] | no_license | <?php
namespace App\Helpers;
use App\Models\Voucher;
use Carbon;
class VoucherHelper
{
private $code = 0;
private $voucher = 0;
public function validate($voucher_code = 0)
{
if(!$voucher_code)
{
return false;
}
$return = [];
$query = Voucher::que... | true |
f25dad70966dc220d645bc4b1c73de016dfce69f | PHP | VinayakSharma27/PHPLabProject | /lab3_exp5_code.php | UTF-8 | 1,185 | 2.640625 | 3 | [] | no_license | <html>
<head>
<style>
body{
color: white;
background-image: url("1.LABBG.jpg");
background-repeat: no-repeat;
background-position: center;
background-attachment: fixed;
}
</style>
</head>
<body>
<form>
Enter the berth : <input type="number" name="number">
<button type="submit" name="Sub" value=... | true |
0db6fe83bc459a9e69de8d0eb1d4dcd685d3da0a | PHP | Kaelyscius/tddbdd | /src/Manager/UserManager.php | UTF-8 | 1,001 | 2.59375 | 3 | [] | no_license | <?php
/*
* This file is part of the tddbdd package.
*
* (c) Matthieu Mota <matthieu@boxydev.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Manager;
use App\Entity\User;
use Doctrine\Common\Persistence\ObjectM... | true |
55a1229b5333fb2f57d3a220798e3a13b08a249d | PHP | bestit/PHP_CodeSniffer | /tests/Sniffs/Formatting/ForbidDoubledWhitespaceSniffTest.php | UTF-8 | 1,299 | 2.53125 | 3 | [
"MIT",
"BSD-3-Clause",
"Apache-2.0",
"OSL-3.0"
] | permissive | <?php
declare(strict_types=1);
namespace BestIt\Sniffs\Formatting;
use BestIt\Sniffs\DefaultSniffIntegrationTestTrait;
use BestIt\SniffTestCase;
use BestIt\TestRequiredConstantsTrait;
use SlevomatCodingStandard\Sniffs\Whitespaces\DuplicateSpacesSniff;
/**
* Test ForbidDoubledWhitespaceSniff
*
* @author blange <b... | true |
a1605d4668ecffd37cb25813a77f8e6137fae07c | PHP | Oxigen2/PiqpoNick20130126 | /Website/common/php/RSSReaderResult.php | UTF-8 | 2,650 | 3.0625 | 3 | [] | no_license | <?php
class RSSReaderResult
{
function __construct($isAtom)
{
$this->_channel = array();
$this->_items = array();
$this->_success = true;
$this->_isAtom = $isAtom;
}
// Returns the information for the channel
function channelInfo()
{
return $this->_channel;
}
// Returns all the items as an ar... | true |
835403928cdc063e4e07f69031fedf56fc7cee58 | PHP | itgalaxy/Itgalaxy-Coding-Standards | /ItgalaxyCodingStandards/Tests/PHP/NoAlternativeSyntaxUnitTest.inc | UTF-8 | 1,395 | 3.71875 | 4 | [
"MIT"
] | permissive | <?php
$foo = 5;
?>
<?php
declare(ticks = 0) :
echo "Statement 1\n";
echo "Statement 2\n";
enddeclare;
?>
<?php
for ($i = 1; $i <= 4; ++$i) :
echo "$i\t";
echo ($i * $i)."\n";
endfor;
?>
<?php for ($i = 1; $i <= 10; ++$i) : ?>
<?php echo "$i\t"; ?>
<?= ($i * $i)."\n"; ?>
<?php endfor; ?>
<?ph... | true |
fda5c3d3f65714e71efe87b8602a5a10d64b0332 | PHP | shimu5/juzzsports | /customer/CustomerManager.php | UTF-8 | 16,428 | 2.734375 | 3 | [] | no_license | <?php
/**
*
* CustomerManager Manager Class
* CustomerManager will manage all about us static page information
*
* @package Customer Manager
* @category Manager
* @author
* @date 28/05/2014
*
*
*/
require_once ROOT . "functions/Connection.php";
require_once ROOT . "classes/Country.php";
requir... | true |
0c7db61269e1aa143a93a381592e1b498a694088 | PHP | Dragomeat/beejee-et | /src/Domain/Tasks/TaskRepository.php | UTF-8 | 831 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace BeeJeeET\Domain\Tasks;
use BeeJeeET\Domain\Slice;
use BeeJeeET\Domain\Specifications\SpecificationInterface;
interface TaskRepository
{
public function getNextIdentity(): TaskId;
/**
* @param Slice $slice
* @return Task[]
*/
public function all(Sl... | true |
176d3dd9e80ef366c20e37de126fc4f0ffaecece | PHP | AlekseiOvchinnikov13/testing_contesting | /mail.php | UTF-8 | 1,271 | 2.515625 | 3 | [] | no_license | <?php
use PHPMailer\PHPMailer\PHPMailer;
try {
$post = $_POST;
$message = "Имя: {$post['name']}<br>";
$message .= "Телефон: {$post['phone']}<br>";
$message .= "Почта: {$post['email']}<br>";
$message .= "Текущий грейд: {$post['grade']}";
require 'phpmailer/PHPMailer.php';
require 'phpmail... | true |
0695dda4e31d3a6e07d248e74c7f28b1a290d621 | PHP | Magomedali/minitube | /api/tests/Feature/DbWebTestCase.php | UTF-8 | 1,123 | 2.578125 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace Test\Feature;
use InvalidArgumentException;
use Psr\Container\ContainerInterface;
use Doctrine\Common\DataFixtures\Executor\ORMExecutor;
use Doctrine\Common\DataFixtures\Loader;
use Doctrine\Common\DataFixtures\Purger\ORMPurger;
use Doctrine\ORM\EntityManagerInterface;
abstrac... | true |
512788cd32e5cf49222f6e76d553e465c2a6c717 | PHP | juanda9002/rips08072021 | /application/models/UsuarioModel.php | UTF-8 | 1,444 | 2.65625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
class UsuarioModel extends CI_model{
public function __construct(){
$this->load->database();
}
public function registrarUusario($cc, $nom, $ape, $tel, $log, $con, $rol){
$sentencia= $this->db->insert("usuario", ["usuCedula" => $cc, "usuNombres" => $nom, "usuApellidos" => $ape, "usuTelefono" => $tel,
... | true |
2188cab1f72311548398652aa7f42d61e8207fa4 | PHP | santigp258/Notes-Application | /edit.php | UTF-8 | 1,824 | 2.515625 | 3 | [] | no_license | <?php include('includes/bdconnect.php');
if (isset($_GET['id'])) {
$id = $_GET['id'];
$query = "SELECT * FROM notas WHERE id = $id";
$result = mysqli_query($conn, $query);
if (mysqli_num_rows($result) == 1) {
$task = mysqli_fetch_array($result);
$title = $task['title'];
$description = $task['descri... | true |
b69b62e37ca5e4d042c5f4ce54a20a040e345cda | PHP | DmitriiKoziuk/yii2-user-manager | /src/data/UserData.php | UTF-8 | 2,056 | 2.6875 | 3 | [] | no_license | <?php
namespace DmitriiKoziuk\yii2UserManager\data;
use yii\base\Component;
use DmitriiKoziuk\yii2UserManager\entities\User;
use DmitriiKoziuk\yii2UserManager\entities\UserProfile;
use DmitriiKoziuk\yii2UserManager\forms\UserInputForm;
use DmitriiKoziuk\yii2UserManager\forms\UserProfileInputForm;
use DmitriiKoziuk\yii... | true |
8bd698b84330a5100216d68917c537d64e61e51a | PHP | PhilN199/EclipseProject | /getData.php | UTF-8 | 1,025 | 2.5625 | 3 | [] | no_license | <?php
$host = "localhost";
$user = "root";
$password = "root";
$dbname = "nasa_v2";
$con = mysqli_connect($host, $user, $password,$dbname);
// Check connection
if (!$con) {
die("Connection failed: " . mysqli_connect_error());
}
$data = json_decode(file_get_contents("php://input"));
$search =... | true |
e9c6e2b728369df6f4890aab56a24d6121f1b610 | PHP | 42ibaran/camagru | /php_src/timeline_paginate.php | UTF-8 | 1,321 | 2.515625 | 3 | [] | no_license | <?php
session_start();
$array = array();
include("../php_src/pdo_init.php");
$stmt = $pdo->query('SELECT * FROM `posts` ORDER BY `id` DESC');
$i = 0;
while (($row = $stmt->fetch()) && $i < $_POST['number_of_posts'] ) {
$i++;
}
if (! $row) {
echo json_encode($array);
... | true |
e3291e117ae15f50529044fd00abfaafcc38df7f | PHP | surajitbasak109/Entry-Voucher | /index.php | UTF-8 | 6,461 | 2.703125 | 3 | [] | no_license | <?php
require_once 'config/db.php';
if(isset($_POST['save']))
{
extract($_POST);
if(!empty($vch_no) && ! empty($entry_name) && ! empty($entry_date) && ! empty($entry_qty) && ! empty($entry_rate) && ! empty($entry_amt) )
{
$query = $pdo->prepare("INSERT INTO entries(entry_vch_no, entry_name, entry_date, entry_qty... | true |
41e7df2a148a98bfc01b20277bbad35123286c6c | PHP | sequoiasnow/sri-nondoc | /php/form/fields/submit_field.php | UTF-8 | 362 | 2.796875 | 3 | [] | no_license | <?php
class SubmitField extends Field {
public function __toString() {
// Ensure the value exists.
if ( ! isset( $this['value'] ) ) {
$this['value'] = 'Save';
}
return
"<div class=\"form-field field-type-submit\">
<input type=\"submit\" value=\"{$thi... | true |
d15c6930b2b87350140eeefa02cac661cae50a5f | PHP | pavlenkoia/codebirdcms | /cms/classes/installer.php | UTF-8 | 2,235 | 2.796875 | 3 | [] | no_license | <?php
/**
* Класс установщик модулей
*/
class Installer
{
private $installCode = 0;
private $installMessage = "";
public function getInstallCode()
{
return $this->installCode;
}
public function getInstallMessage()
{
return $this->installMessage;
}
/**
* Ин... | true |
a350d9622bfe551afdeb944df510c99738063287 | PHP | ciniki/businesses | /private/reportChunkTable.php | UTF-8 | 2,020 | 2.5625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
//
// Description
// ===========
// This function will add a table to the report.
//
// Arguments
// ---------
// ciniki:
// tnid: The ID of the tenant the reports is attached to.
// report_id: The ID of the reports to get the details for.
//
// Returns
// -------
//
function ciniki_tenants_repo... | true |
7f9190b5c164867aca2d97f4a21163c26ae99240 | PHP | spielmangames/fafi | /draft/scheduler/schedulerTester.php | UTF-8 | 6,351 | 2.859375 | 3 | [] | no_license | <?php
class schedulerTester
{
// Q errors
public const ERR_INVALID_GAMES_IN_POOL_QTY = 'Qty of Games in a pool is %d instead of %d';
public const ERR_INVALID_MATCHDAYS_IN_POOL_QTY = 'Qty of Matchdays in a pool is %d instead of %d';
public const ERR_INVALID_LAPS_IN_POOL_QTY = 'Qty of Laps in a pool is %... | true |
8661f99b69f122a683fcd3b07db04da123fc947d | PHP | mrpbueno/pdo | /pages/cadastro.php | UTF-8 | 852 | 2.921875 | 3 | [] | no_license | <?php
$nome = isset($_POST['nome']) ? $_POST['nome'] : null;
$nota = isset($_POST['nota']) ? $_POST['nota'] : null;
// Verifica se uma das variáveis não estão vazias
if(!empty($nome) || !empty($nota)) {
// Salva e redireciona para home
createAluno($nome, $nota);
header("Location: http://{$_SERVER['HTTP_HO... | true |
ace0ec915536bb3250fac33cce68b98e55b31be2 | PHP | paulpichonMekaDesign/APIMekaDesign | /modelos/conexion.php | UTF-8 | 390 | 2.703125 | 3 | [] | no_license | <?php
class Conexion{
static public function conectar(){
try {
$conexion = new PDO('mysql:host=localhost;dbname=mekadesign', 'root', '');
$conexion -> exec("set names utf8");
return $conexion;
} catch (Exception $... | true |