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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
14221f14808453f19c1eabb985b9933c6ce8e0af | PHP | cdeguzman/DLSUTCS | /server/php/StudentPage/getAllStudent.php | UTF-8 | 409 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
//This code displays all the student name
include("../connect.php");
$select_student = mysql_query("SELECT id, CONCAT(lname, ', ' ,fname, ' ', mi) as studentName FROM student");
$list_student = array();
while($fetch_student = mysql_fetch_assoc($select_student)){
$lis... | true |
030aca5b78c2867764e05c3d20f4eb815a405014 | PHP | isaactauber/tours | /open_source.php | UTF-8 | 895 | 3.0625 | 3 | [] | no_license | <?php
//start session
session_start();
//configure mysql database
require_once 'config.php';
//make sure user is still logged in and session has not expired
if(!isset($_SESSION['username']) || empty($_SESSION['username'])){
header("location: login.php");
exit;}
//save json object passed in by the AJAX request int... | true |
712f4e06046df98f7244f8db653dd2e12dce7c48 | PHP | yung-Twist/php_study | /01_php基础/06_函数/03_常用数学函数.php | UTF-8 | 1,289 | 3.75 | 4 | [] | no_license | <?php
/**
* max: 取得若干个数据中的最大值
*min: 取得若干个数据中的最小值
*round: 对某个数据进行四舍五入(可以设定保留几位小数)
*ceil: 对某个数“向上取整”:将一个数据往上找出其小的一个整数(含其本身)。
*floor: 对某个数“向下取整”:将一个数据往下找出其大的一个整数(含其本身)
* $n1 = floor(4.1); //4
* $n2 = floor(4.9); //4
* $n3 = floor(4); //4
... | true |
7f1949c244e1a8d3752448ccd02bdb96ea0f8a99 | PHP | Abug0/aabug.github.io | /blog/blogPublish.php | UTF-8 | 2,492 | 2.546875 | 3 | [] | no_license | <?php
/**
* 作者:.
* 描述:Blog的发表界面
* 创建日期:2017.11
* 修改日期:2017.11.26
*/
require_once("../php_class/Blog.class.php");
require_once("../php_class/User.class.php");
require_once("../php_class/BlogSearchImpl.class.php");
require_once("../php_class/BlogStatisticsImpl.class.php");
if(!isset($_SESSION))
session_start... | true |
c351c08d377a74643e5ddb879de7e72882b3f109 | PHP | tengzhouboy/AHUTWX | /common.php | UTF-8 | 1,462 | 2.765625 | 3 | [] | no_license | <?php
include('db.class.php');
include('user.class.php');
include('profile.class.php');
include('food.class.php');
define("TOKEN", "ahutapp");
const PROFILE_TABLE = 'baseprofile2013';
const LESSON_TABLE = 'lesson2013_1';
const RESULT_MAX = 40;
const TEXT_BANNER = '-----------------';
$GLOBALS['weeks'] = array('周一', '... | true |
c2fbac7704653221d6db8163487b6a3bd3f9115b | PHP | suyash515/calopi-framework | /includes/classes/gui/fileGeneration/PageTitlePHPFileWriter.php | UTF-8 | 2,822 | 3.15625 | 3 | [] | no_license | <?php
/**
* Description of PageTitlePHPFileWriter
*
* @author suyash
*/
class PageTitlePHPFileWriter extends GenericPHPFileWriter
{
private $tableEntityList;
public function __construct($folder, $fileName, $tableEntityList)
{
parent::initialise($folder, $fileName, GenericFileWriter::$PHP_EXTENSION)... | true |
a2ddfb7b4acf0b8e1f6bdc2832426682e6a681dc | PHP | ahmedelsabahy/shopping-online | /Database.php | UTF-8 | 558 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
class Database
{
var $conn;
function __construct()
{
$this->conn=mysqli_connect("mysql5031.site4now.net","a69bd5_ntidb","ABC@123456","db_a69bd5_ntidb");
}
//To Insert- Update - delete
function RunDML($statment)
{
if(!mysqli_query($this->conn,$statment))
{
... | true |
c4c2fa10581e9cae1ec38904df130e8a479a55dd | PHP | gizmore/gwf5-votes | /GWF_VoteTable.php | UTF-8 | 1,285 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
class GWF_VoteTable extends GDO
{
/**
* @return GDO
*/
public function gdoVoteObjectTable() {}
public function gdoVoteMax() { return 5; }
public function gdoCached() { return false; }
public function gdoAbstract() { return $this->gdoVoteObjectTable() === null; }
public function gdoColumns()
{
return ... | true |
c10f2f22d6c91162ca45897fa41def4d1b3e9fd4 | PHP | maclxf/bigtalk | /limelight/tests/Unit/MecabTest.php | UTF-8 | 1,272 | 2.75 | 3 | [
"MIT"
] | permissive | <?php
namespace Limelight\tests\Unit;
use Limelight\Config\Config;
use Limelight\Tests\TestCase;
class MecabTest extends TestCase
{
/**
* @var implements Limelight\Mecab\Mecab
*/
protected static $mecab;
/**
* Set static mecab on object.
*/
public static function setUpBeforeClass... | true |
c235f3b3e7a699ea58335bb6979e88ec6a37ee71 | PHP | zawau/tisarana | /admin/app/tests/app/models/GroupTest.php | UTF-8 | 2,339 | 2.859375 | 3 | [
"MIT"
] | permissive | <?php
/**
* Testing Group model.
*/
class GroupTest extends TestCase
{
public static function setUpBeforeClass()
{
// Set up array in global space to delete all test records.
// Using global to avoid phpunit reinitalizing variables after each test.
global $ids;
$ids = array();... | true |
c08ca66a3565d4065b7b3bcb3e2f1c22d6caf570 | PHP | narbelys/fototea | /beta/fototea/scripts/libSM.php | UTF-8 | 37,461 | 2.5625 | 3 | [] | no_license | <?php
use Fototea\Config\FConfig;
use Fototea\Models\User;
use Fototea\Util\DateHelper;
$hostname_h = FConfig::getValue('db_hostname');
$database_h = FConfig::getValue('db_name');
$username_h = FConfig::getValue('db_user');
$password_h = FConfig::getValue('db_password');
$db = mysql_pconnect($hostname_h, $username_h... | true |
e67cf4646c287e4682777ced02deed6f760bd43f | PHP | TinTanNTXinh/vsys | /app/Http/Controllers/PositionController.php | UTF-8 | 4,968 | 2.71875 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use App\Position;
use Illuminate\Http\Request;
use League\Flysystem\Exception;
use Route;
use DB;
class PositionController extends Controller
{
private $firstDayUTS;
private $lastDayUTS;
private $format_date;
private $table_name;
function __construct()
{... | true |
851acde5f4ddd07eb90c22e9383735a9d5102001 | PHP | superelebe/mini | /app/Http/Controllers/ArticleController.php | UTF-8 | 4,671 | 2.546875 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Article;
use Image;
class ArticleController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$title = 'Index - article';
... | true |
f243f4057bc3a04186fee4ddf282de6f074e4aed | PHP | lminuzzi/mobil | /controllers/FarolController.php | UTF-8 | 1,859 | 2.578125 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: Alessandro
* Date: 14/10/2017
* Time: 14:08
*/
class FarolController extends controller
{
public function index()
{
$dados = array();
$f = new Farol();
$dados['farois'] = $f->getAllFarois();
$dados['farois_realizados'] = $f->getAllFar... | true |
11aacbd4f2af7c6c03097edb427912022686f504 | PHP | ssnau/chatroom | /lib/ToolLib.php | UTF-8 | 3,772 | 2.875 | 3 | [] | no_license | <?php
class ToolLib {
public static function get($varname) {
if (isset($_GET[$varname])) {
return $_GET[$varname];
}
return false;
}
public static function post($varname) {
if (isset($_POST[$varname])) {
return $_POST[$varname];
}
return false;
}
public static function request($... | true |
d180c0ed18ab73a6da44c61f5fdc8f65a5c28754 | PHP | Jakub-Fajkus/iis | /src/AppBundle/Menu/AppMenuBuilder.php | UTF-8 | 2,240 | 2.578125 | 3 | [] | no_license | <?php
namespace AppBundle\Menu;
use AppBundle\Entity\Employee;
use Knp\Menu\FactoryInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
/**
* Class AppMenuBuilder
*
* @package AppBundle\Menu
*/
class AppMenuBuilder
{
/**
* @var FactoryInterface
*/
p... | true |
29c2013e29bbb1c8155beb4326e1dbffaea47888 | PHP | Andre1753/CalorieCounter | /app/Observers/FoodObserver.php | UTF-8 | 1,127 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Observers;
use App\Models\Food;
class FoodObserver
{
/**
* Handle the Food "created" event.
*
* @param \App\Models\Food $food
* @return void
*/
public function created(Food $food)
{
$food->calories = ($food->carbohydrate * 4) + ($food->protein * 4) +... | true |
3968de8bb233e48370b20328bc449d33a6f9c92a | PHP | symbiose/symbiose | /lib/manager/UserManager_jsondb.class.php | UTF-8 | 5,024 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace lib\manager;
use \lib\entities\User;
use \lib\entities\UserToken;
use \RuntimeException;
class UserManager_jsondb extends UserManager {
// GETTERS
// Users
public function listAll() {
$usersFile = $this->dao->open('core/users');
$usersData = $usersFile->read();
$list = array();
foreach(... | true |
3ccb5d42913442d1319f984e7c09fd8216ddb13b | PHP | mobtexting/mobtexting-laravel | /src/MobtextingChannel.php | UTF-8 | 2,467 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace NotificationChannels\Mobtexting;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Notifications\Events\NotificationFailed;
use Illuminate\Notifications\Notification;
use NotificationChannels\Mobtexting\Exceptions\CouldNotSendNotification;
class MobtextingChannel
{
/**
... | true |
b04f2b9950776642d33b48f8405389ea52a07102 | PHP | iVariable/iVariableExtraBundle | /Service/User.php | UTF-8 | 533 | 2.8125 | 3 | [] | no_license | <?php
/**
* Тупо геттер для юзера
*/
namespace iVariable\ExtraBundle\Service;
class User
{
/**
*
* @var TIM\TIMBundle\Entity\User
*/
protected $user;
public function __construct( $context ){
$this->user = $context->getToken()->getUser();
}
public function _get(){
return $this->user;
}
public fun... | true |
b39efbf0089ab2576dc8806e591d7c0cc92f1d01 | PHP | victoriachan/victoriac-blog | /themes/lean/template.php | UTF-8 | 18,546 | 2.578125 | 3 | [] | no_license | <?php
// $Id$
/**
* @file
* template file for subtheme, lean
*/
/**
* Format a date field to nice blog-style date
*/
function _lean_make_blog_date($datefield, $link = null) {
$arr_created_date_parts = explode('-', format_date($datefield, 'custom', 'D-d-F-Y'));
$ret .= '<span class="month">'.$arr_created_date... | true |
01d6f6778fdbf0d5a1d7b9ab7ed6e6409d3b365a | PHP | SergeyBel/Pdfbuilder | /src/Type/Dictionary.php | UTF-8 | 942 | 3.34375 | 3 | [
"MIT"
] | permissive | <?php
namespace PdfBuilder\Type;
class Dictionary implements Type
{
/** @var Type[] $data */
private $data;
public function __construct(array $data)
{
$this->data = $data;
}
public function toString()
{
$text = "<<\n";
foreach ($this->data as $k... | true |
2ab258758308797bab9c89103518643905a5a2d3 | PHP | mimmi20/browscap-helper-source | /src/Helper/FilePath.php | UTF-8 | 853 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
/**
* This file is part of the browscap-helper-source package.
*
* Copyright (c) 2016-2023, Thomas Mueller <mimmi20@live.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types = 1);
namespace BrowscapHelpe... | true |
d3a6280400e5fab5dd62d77b8307de05b23acd66 | PHP | Pixy/Pixy | /Site/ajax-envoyer-mail.php | UTF-8 | 1,980 | 2.71875 | 3 | [] | no_license | <?php
header('Content-type: text/html; charset=UTF-8');
require_once('php_mailer/class.phpmailer.php');
include("php_mailer/class.smtp.php");
/* VARIABLES */
$email = clean_text($_POST['mail']);
$nom = (empty($_POST['nom'])) ? 'unNom' : clean_text($_POST['nom']);
$prenom = (empty($_POST['prenom'])) ? 'unPrenom' : cle... | true |
6fccd6eeb31b79f3698d5e30a44dd9928e396909 | PHP | RenPengJu0610/tp6_shop | /app/common/lib/sms/TencentSms.php | UTF-8 | 857 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | <?php
declare(strict_types=1);
namespace app\common\lib\sms;
use think\facade\Log;
class TencentSms implements SmsBase
{
/**
* 腾讯云发送短信验证码的场景
* @param string $phone
* @param int $code
* @return bool
* @date 2020/12/18/22:52
* @author RenPengJu
*/
public static function sendC... | true |
0f3fcd9d7ba2a75d2040ad46b75ab561b07a1ad4 | PHP | ahmedash95/Advaned-PHP-CMS-Script | /vendor/NPD/Encryption.php | UTF-8 | 379 | 2.796875 | 3 | [] | no_license | <?php
class Encryption{
public function encrypt($data)
{
return sha1(uniqid(mt_rand())) . base64_encode(serialize($data)) . sha1(uniqid(mt_rand()));
}
public function decrypt($data)
{
if(!$data) return;
$pos = strpos($data , substr($data , -40));
$data = substr($data , 40 , $p... | true |
dde900559115771cf088ba6638a9d0460b1b6c64 | PHP | luis1415/SW | /dao/AlbumDAO.php | UTF-8 | 2,419 | 2.859375 | 3 | [] | no_license | <?php
include_once "../config/ConfigDB.php";
include "../models/Album.php";
class AlbumDAO extends ConfigDB{
public function fecthData($id_user){
$sql = $this->connect()->prepare("SELECT * FROM tbl_albumes WHERE id_user=:id_user");
$sql->bindParam(':id_user', $id_user);
... | true |
4d69749e6f5bc6e20ccad69959943f95002b8bdb | PHP | alaa-almaliki/string-utils | /src/Validator/Time.php | UTF-8 | 3,062 | 3.25 | 3 | [] | no_license | <?php
namespace StringUtils\Validator;
/**
* Class Time
* @package StringValidator
* @author Alaa Al-Maliki <alaa.almaliki@gmail.com>
*/
class Time extends AbstractString
{
/** @var array */
private static $defaultTimeFormats = [
'h:i',
'h:i:s',
'H:i',
'H:i:s'
];
/... | true |
fb51216df6b7824a042fe626878955520dae86f9 | PHP | shadihrr/Mink | /src/Behat/Mink/Element/Element.php | UTF-8 | 5,226 | 2.984375 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of the Mink package.
* (c) Konstantin Kudryashov <ever.zet@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Behat\Mink\Element;
use Behat\Mink\Session;
/**
* Base element.
*
* ... | true |
d86e14c413af6aaa32db4ca6b24e61d957195c2a | PHP | andri000me/nilai_siswa | /frmeditcust.php | UTF-8 | 2,277 | 2.65625 | 3 | [] | no_license | <?php
include "koneksi.php";
// Jika Tombol Simpan ditekan
if (isset($_POST['submit'])){
// Cek Jika Input Masih ada yang Kosong
if ((!empty($_POST['CUST_CODE'])) || (!empty($_POST['CUTS_NAME'])) || (!empty($_POST['ALMT_CMPY'])) || (!empty($_POST['ALMT_DELV']))){
// Update Data
$sql = "UPDATE tb_custxm SET CUST_CODE... | true |
0337b460e7c3bbc1efce98e637a3fe8fba4dde22 | PHP | dmirogin/Validation | /library/Rules/CreditCard.php | UTF-8 | 2,262 | 2.921875 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of Respect/Validation.
*
* (c) Alexandre Gomes Gaigalas <alexandre@gaigalas.net>
*
* For the full copyright and license information, please view the "LICENSE.md"
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Respect\Validation\Rules;
use... | true |
e62b0f5b084fc812430e1c8f6554f5baca310039 | PHP | floegel/brainteaser-api | /src/Brainteaser/Application/Command/SolveExerciseCommand.php | UTF-8 | 1,108 | 3.1875 | 3 | [
"MIT"
] | permissive | <?php
namespace Brainteaser\Application\Command;
use Brainteaser\Domain\Exercise\TileSet;
class SolveExerciseCommand
{
/**
* @var string
*/
private $trainingId;
/**
* @var string
*/
private $exerciseId;
/**
* @var TileSet
*/
private $solutionTileSet;
/... | true |
f0d0f27af4eecd817dd7a2845afdca7c746a246e | PHP | xiaonian0430/hp-core-swoole | /hiper-frame/Log/Log.php | UTF-8 | 1,723 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
/**
* @author: Xiao Nian
* @contact: xiaonian030@163.com
* @datetime: 2019-12-01 14:00
*/
namespace HP\Log;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Monolog\Formatter\LineFormatter;
/**
* 日志
*
* @method static void log($level, $message, array $context = [])
* @method static void debug($m... | true |
1462d5faed08134552d9f1966cabc554f57d8daa | PHP | kcemenike/intranet | /api/database/migrations/2019_11_08_082206_create_articleables_table.php | UTF-8 | 758 | 2.53125 | 3 | [] | no_license | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateArticleablesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('articleabl... | true |
0454efba7f402e93d7d4653f9351ef4be0205308 | PHP | LasithaPrabodha/calendar-php | /core/Input.php | UTF-8 | 864 | 3.125 | 3 | [] | no_license | <?php
class Input
{
private function fetch_from_array(&$array, $index = null)
{
// If $index is NULL, it means that the whole $array is requested
isset($index) or $index = array_keys($array);
// allow fetching multiple keys at once
if (is_array($index)) {
$output = ... | true |
023fbe7a0f889342164a70060f0e338a80055894 | PHP | spring369/laravel-upload | /src/Listeners/FileListener.php | UTF-8 | 533 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
namespace Windmill\Upload\Listeners;
use Windmill\Upload\Events\UploadEvent;
class FileListener
{
public function __construct()
{
}
public function handle(UploadEvent $event)
{
if ( ! $request = $event->getRequest()) {
return false;
}
$fileName = str_rand... | true |
00932a9d0a4acd0254162262c20b0c82d3f0d6f9 | PHP | duytruong2996/shop1701 | /helper/functions.php | UTF-8 | 185 | 2.875 | 3 | [] | no_license | <?php
function createToken(){
$str = "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890";
$token = '';
for($i=1; $i<=30; $i++){
$token.= substr($str,rand(0,strlen($str)-1),1);
}
return $token;
}
?> | true |
04890b2c6b27dd5862b19ed5e6bb3de238368fdc | PHP | Josecanturiano/BackendPractice | /api/contact/read.php | UTF-8 | 2,215 | 2.875 | 3 | [] | no_license | <?php
// required headers
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
// include database and object files
define('__ROOT__', dirname(dirname(__FILE__)));
include_once(__ROOT__.'/config/db.php');
include_once(__ROOT__.'/models/contact_model.php');
// instanti... | true |
eb0f0ee1ddc02f7940563cacaffab7913371fda8 | PHP | hkurosawa/OpenWeatherMapWrapper | /test/OpenWeatherMapWrapperTest.php | UTF-8 | 1,943 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
//require_once('/usr/lib/php/share/pear/PHPUnit/Framework/TestCase.php');
require_once('../src/OpenWeatherMapWrapper.class.php');
class OpenWeatherMapWrapperTest extends PHPUnit_Framework_TestCase {
var $owm = null;
public static function setUpBeforeClass() {
//do nothing
}
publ... | true |
67980cc244deac59fcc2a4a5a57610f4bd4f7aad | PHP | teamshadi/ffa-php-cli | /src/FfaPhp/Console/Command/TreasuryDebitInterest.php | UTF-8 | 1,601 | 2.78125 | 3 | [] | no_license | <?php
namespace FfaPhp\Console\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputOption;
// http://symfony.com/doc/current/console.html
class TreasuryDebitInterest e... | true |
a7313bca170516221708a40933fd040a0bdb380d | PHP | sandeep2863/AMSAET_HOST | /admin/enquiries.php | UTF-8 | 1,340 | 2.5625 | 3 | [] | no_license | <?php
include("header.php");
$query="SELECT * FROM enquiry_rep";
$data=mysqli_query($con,$query);
$num = mysqli_num_rows($data);
$j = ceil($num/6);
if(isset($_GET['page']))
{
$page = $_GET['page'];
$page = ($page-1)*6;
$qry2 = "select * from enquiry_rep limit 6 offset $page";
}
else... | true |
c522e5dea89594b644a750ab9d83e22ba5ce0e67 | PHP | HugoPoletto34/HeyPott---Portal-de-Noticias | /HeyPott - Portal de Notícias/index.php | UTF-8 | 637 | 2.578125 | 3 | [] | no_license | <?php
$pagina = 'home';
if(isset($_GET['pagina'])){
$pagina = addslashes ($_GET['pagina']);
}
//Carrega o header.php
include 'views/header.php';
//Carrega a página escolhida pelo usuário
switch ($pagina){
case 'secao1':
include 'views/secao1.php';
break;
case 'secao2'... | true |
2ab5dcd6c833e2d95016cc2e82ddbd745c1221d3 | PHP | Antoine-PETIT-Loco/test_sdvi_Antoine_Petit | /src/Repository/PizzeriaRepository.php | UTF-8 | 1,358 | 2.578125 | 3 | [] | no_license | <?php
declare(strict_types = 1);
namespace App\Repository;
use App\Entity\Pizzeria;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* Class PizzeriaRepository
*/
class PizzeriaRepository extends ServiceEntityRepository
{
/**
* PizzeriaR... | true |
b1d99e5f47b5de6d7bf95d148d72e491ebb6b717 | PHP | TestDp/Ecotickects | /app/Ecotickets/Datos/Repositorio/CuponesRepositorio.php | UTF-8 | 740 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: LaPoint
* Date: 8/05/2018
* Time: 1:51 PM
*/
namespace Eco\Datos\Repositorio;
use Eco\Datos\Modelos\Ciudad;
use Eco\Datos\Modelos\Departamento;
use Eco\Datos\Modelos\Evento;
class CuponesRepositorio
{
public function ObtenerMisCupones($idUsuario)
... | true |
8483bc28a1c15dd74e8279a8a6e42b3c6df4c8df | PHP | fukata/pinoco | /test/unit/test_vars.php | UTF-8 | 4,587 | 2.75 | 3 | [] | no_license | <?php
require_once dirname(__FILE__) . '/../lib/lime.php';
require_once dirname(__FILE__) . '/../../src/Pinoco/VarsList.php';
$t = new lime_test();
$t->diag("Pinoco_Vars Test");
$v = new Pinoco_Vars();
$v->set('foo', 'bar');
$t->is($v->has('foo'), true, "Vars can check value previously set.");
$t->is($v->has('xxx'), ... | true |
f822d17e38c583352e36bd0354d1bf460096c7c4 | PHP | kriosguerra3/draDiet | /app/Models/Food.php | UTF-8 | 891 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Eloquent as Model;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
* Class Food
* @package App\Models
* @version October 11, 2017, 9:47 pm UTC
*
* @property string name
*/
class Food extends Model
{
use SoftDeletes;
public $table = 'foods';
const CREATED_AT =... | true |
a5fb1d96e4a1822a9c389c181fe12cd69a716ba1 | PHP | qrichert/goji | /bin/add-terminal.php | UTF-8 | 442 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
/*
* Put this in public/ and execute it from the browser
*/
header('Content-Type: text/plain');
$return_var = null;
ob_start();
system('ln -sfv ../../_terminal/public/ ./terminal', $return_var);
$output = ob_get_clean();
if ($return_var === 0) // 0 = no error
echo "OK";
else
echo "ERROR: $return_var";
e... | true |
68e79ec7a880cf98c78ee91ec3e0f62939b55c53 | PHP | brunocaramelo/estudos | /php/sistemadecaixa/Caixa/Tests/teste_moeda.php | UTF-8 | 1,318 | 3.046875 | 3 | [] | no_license | <?php
spl_autoload_register(function($class){
require '../'.$class.'.php';
});
use Caixa\Modelo\Moeda;
$valorDoPrato = new Moeda(25);//R$
$valorPago = new Moeda(40,'GUA');
// 40 GUA = 20 BRL
function testarConverter($moeda,$esperado){
$troco = $moeda->converter($moeda);
if($troco === $es... | true |
16eb4813ffb1d3be48c6fc5c84444eed2e9a7b11 | PHP | Breno098/azuos | /src/Tools/AzArr.php | UTF-8 | 972 | 2.921875 | 3 | [] | no_license | <?php
namespace Azuos\Tools;
class AzArr
{
static function explode(string $delimiter, string $string, array $keys = [], bool $length = false)
{
$explodeArray = explode($delimiter, $string);
if($length){
$explodeArray['length'] = count($explodeArray);
}
if(!$keys)
... | true |
b8c6ba233d28c5b3a6b96a81f74f56c5bc505b9b | PHP | mouradeljayi/mvc_gestion_employee | /models/User.php | UTF-8 | 1,058 | 3 | 3 | [] | no_license | <?php
/**
* Class User
*/
class User
{
public static function authentificate($data)
{
$pseudo = $data['pseudo'];
try {
$query = "SELECT * FROM users WHERE pseudo=:pseudo";
$statement = DB::connect()->prepare($query);
$statement->execute(array(":pseudo" => $pseudo));
$user = $stat... | true |
bfbef88bdd717b14207c0e070f33024840e4c825 | PHP | MiriamSantanaEspinosa/Aplicaciones | /AppData/Controller/registrarController.php | UTF-8 | 1,723 | 2.5625 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: Alex
* Date: 16/10/2018
* Time: 10:37 PM
*/
namespace AppData\Controller;
class registrarController
{
private $registrar,$sexos,$personas, $tipos_usu, $usuario;
public function __construct()
{
$this->registrar = new \AppData\Model\registrar();
... | true |
c8b93768f9c0e6793d42ba5977638386f02e5812 | PHP | HuyVanChu/vanhuyshop | /app/Services/ProductService.php | UTF-8 | 2,206 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Services;
use App\Models\Categories;
use App\Models\Products;
use App\Models\Variants;
use Illuminate\Database\Eloquent\ModelNotFoundException;
class ProductService
{
public function search($id)
{
$product = Products::find($id);
if (!$product) {
throw new Model... | true |
d5c48fe11290b3b7279293a47f136ca40e24f088 | PHP | Nikita-C47/HR-php-test | /app/Notifications/OrderFinishedEmail.php | UTF-8 | 1,746 | 2.78125 | 3 | [] | no_license | <?php
namespace App\Notifications;
use App\Order;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\MailMessage;
/**
* Класс, представляющий уведомление о завершении заказа.
* @package App\Notifications Уведомления приложения.
*/
class OrderFinishedEmai... | true |
b0e879a9928ed9ab6d8c744cc5512e26dfb7bd01 | PHP | qrak/MW-Pomoc | /strony/kontakt.php | UTF-8 | 1,820 | 2.53125 | 3 | [] | no_license | <?php
// sprawdzamy, czy zmienna $submit jest pusta
if (empty($_POST['submit'])) {
// wy+Ťwietlamy formularz
echo "<table border=\"0\"><form method=\"post\">
<tr>
<td>Twoje imię/ksywka:</td>
<td><input type=\"text\" name=\"nick\" style=\"width: 250px\"></td>
</tr>
<tr>
<td>Twój e-mail:</td>
<td><input type=\"t... | true |
1f28e8593fb74fca1d58720847fc948a381cde5f | PHP | fVazquezs/Supplies-store-API | /src/productOrder/ProductOrderCtrl.php | UTF-8 | 900 | 2.78125 | 3 | [] | no_license | <?php
require_once "ProductOrder.php";
require_once "ProductOrderDAO.php";
class ProductOrderCtrl
{
public function listByOrder($id)
{
$dao = new ProductOrderDAO();
$list = $dao->listByOrder($id);
return $list;
}
public function insert($orderId, $productId, $quantity)
{
... | true |
6d29837676666c0bebc415e23cf629f7dcc13cf0 | PHP | sesehai/myproject | /php/xmlrpc/xmlrpc_client.php | UTF-8 | 704 | 2.59375 | 3 | [] | no_license | <?php
require_once 'XML/RPC.php';
$input = "lisi";
$params = array(
new XML_RPC_Value($input, 'string'),
new XML_RPC_Value("30", 'int'),
);
$msg = new XML_RPC_Message('obj', $params);
$cli = new XML_RPC_Client('/rpc/xmlrpc.php', '33.33.33.10');
// $cli->setDebug(1);
$resp = $cli->send($msg);
if (!$resp) {
... | true |
152f092de1a05c761c044a049aee1ce9f54addc1 | PHP | quocsang/doanphp | /controllers/CustomerController.php | UTF-8 | 2,298 | 2.578125 | 3 | [] | no_license | <?php
include_once MODEL_DIR . "/Customer.php";
include_once MODEL_DIR . "/Company.php";
include_once MODEL_DIR . "/Person.php";
include_once MODEL_DIR . "/User.php";
/**
*
*/
class CustomerController extends Controller
{
public function beforeAction()
{
//
if (! $this->app-... | true |
fca471c349525198a01cd4ebe1964bf308684321 | PHP | CMSC-129C-Projects/UP-HIGH-SET | /app/Models/SectionModel.php | UTF-8 | 1,478 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use CodeIgniter\Model;
class SectionModel extends Model {
protected $table = 'eval_section';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'array';
protected $allowedFields = [
'sec_order',
'name',
'question_type_id... | true |
1f54cebec66898ee3a48e421d731ef5b7ba1ad5d | PHP | gallowag/cs313-php | /web/project01/nav.php | UTF-8 | 1,358 | 2.859375 | 3 | [] | no_license | <?php
$file = pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME);
if (!isset($db)) {
require("dbConnect.php");
$db = get_db();
}
?>
<br>
<h1>K-drama Review</h1>
<nav class="navbar navbar-default">
<div class="container-fluid">
<ul class="nav navbar-nav">
<li class="nav-item<?php if ($file === 'home') echo '... | true |
e7567752e648b955d70a8cd9cb53949d83fcb1f1 | PHP | harrynewsome/livewire | /tests/SubsequentComponentRequestsMustMatchOriginalComponentTest.php | UTF-8 | 1,216 | 2.765625 | 3 | [] | no_license | <?php
namespace Tests;
use Livewire\Component;
use Livewire\Exceptions\ComponentMismatchException;
class SubsequentComponentRequestsMustMatchOriginalComponentTest extends TestCase
{
public function test()
{
$this->expectException(ComponentMismatchException::class);
app('livewire')->component... | true |
60605f6fe141851e0cb87bd02924f269d64958ba | PHP | jorgemare/Drupal-Context-Condition-Referer | /plugins/context_condition_referer.condition.inc | UTF-8 | 1,510 | 2.875 | 3 | [] | no_license | <?php
class context_condition_referer_context_referer extends context_condition {
/**
* Omit condition values. We will provide a custom input form for our conditions.
*/
function condition_values() {
return array();
}
/**
* Condition form.
*/
function condition_form($context) {
$form = p... | true |
5ccdd82a4fcd04b425c3db20ba2faefb9b8849e1 | PHP | comm644/temis | /xml/xmlbase_php4.php | UTF-8 | 2,452 | 2.65625 | 3 | [] | no_license | <?php
/*
Copyright (c) 2008 Alexey V. Vasilyev
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applic... | true |
5f8523af6ea548c8396b09d8d75297d20471bd2f | PHP | number5wh/gameoc | /.svn/pristine/e2/e273bf239f9ed614cf850b36a6fedda6d31937c7.svn-base | UTF-8 | 6,595 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace alipay;
use app\common\Api;
//支付宝
class Withdraw
{
private $merid = '2019091116163825367';
private $url = "http://www.ganzaoji99.com/api.php/gateway/gateway_order_pay";
private $notify = "http://mt.gamefeizhu.com/admin/withdraw/alipaynotify";
private $publicKey = "MIIBIjANBgkqhkiG9w0... | true |
3bc395f80420a29a77ad73ff0eacb3575eb13430 | PHP | vmonjaret/movie-api | /src/Controller/Collection/GetMovies.php | UTF-8 | 992 | 2.640625 | 3 | [] | no_license | <?php
namespace App\Controller\Collection;
use App\Entity\Collection;
use App\Entity\User;
use App\Utils\MovieHydratation;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
class GetMovies
{
private $tokenStorage;
private $movieHydratation;
/**
* ListMovies con... | true |
358517df4b3d44afa2ae1e6f5fd4f34aa40c586f | PHP | petemcfarlane/Eshop | /src/Eshop/Product/ProductCatalog.php | UTF-8 | 590 | 3.09375 | 3 | [] | no_license | <?php
namespace Eshop\Product;
class ProductCatalog
{
/**
* @var Product[]
*/
private $products = [];
/**
* @param Product[] $products
*/
public function addProducts(array $products)
{
$this->products += $products;
}
/**
* @param Category $category
*... | true |
a3a9e744cf1f114d60b6625ee6ebd56baf8e6a15 | PHP | Ad3bay0c/Autoloading | /App/Library/Blog.php | UTF-8 | 2,509 | 3.171875 | 3 | [] | no_license | <?php
namespace App\Library;
use App\Config\Database;
class Blog {
const DB_USER = 'blog';
//static function to create new item to Blog table
static public function insert(array $data) {
$db = Database::connect();
$keyData = array ();
$valueData = "";
foreach ($data as ... | true |
86b053aa763e00d7c62fec282dc5ff5f6777b602 | PHP | AndrewOzarko/practice-project | /app/Http/Controllers/GroupController.php | UTF-8 | 1,547 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use App\Group;
use App\Http\Requests\CreateGroupRequest;
use App\Http\Requests\DeleteGroupByNameRequest;
use App\Http\Requests\GetGroupByName;
use App\Http\Requests\GetGroupByNameRequest;
use App\Http\Requests\GetGroupsRequest;
use App\Http\Requests\GroupPageRequest;
use Illumina... | true |
27ab702104c2364f5b5003a923df193251b7ac3a | PHP | ShibuyaKosuke/laravel-database-validation | /src/Console/RulePublishCommand.php | UTF-8 | 4,729 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
namespace ShibuyaKosuke\LaravelDatabaseValidator\Console;
use Illuminate\Console\Command;
use Illuminate\Support\Str;
use ShibuyaKosuke\LaravelDatabaseUtilities\Models\Column;
use ShibuyaKosuke\LaravelDatabaseUtilities\Models\Table;
class RulePublishCommand extends Command
{
/**
* The name and signatu... | true |
ae6d435e6ef09cf86873accea4230818e7b35e33 | PHP | gomathiaravindan/Hostel_Management_Portal | /profile.php | UTF-8 | 2,173 | 2.53125 | 3 | [] | no_license | <?php
session_start();
include "config.php";
$user = $_SESSION['login_user'];
if(isset($user))
{?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Profile Page</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0... | true |
57bb16add06a9dc2f116d6c2e1068e5ae069a725 | PHP | nusje2000/websockets | /src/Socket/Event/FrameEvent.php | UTF-8 | 1,015 | 3.046875 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace Nusje2000\Socket\Event;
use Nusje2000\Socket\Connection\SocketConnectionInterface;
use Nusje2000\Socket\Frame\FrameInterface;
use Nusje2000\Socket\WebSocketInterface;
final class FrameEvent extends AbstractSocketEvent implements ConnectionAwareEvent
{
/**
* @var Soc... | true |
15a7ff343419eefcea56be9e9954fa96149dc8ab | PHP | BrendanJackson/media-library | /inc/connection.php | UTF-8 | 1,075 | 3.203125 | 3 | [] | no_license | <?php
//THIS BLOCK CONNECTS TO THE DATABASE, IF IT CANNOT CONNECT IT 'CATCHES' THE ERROR AND SENDS USER A MESSAGE
try{
//new(lets php know we're creating an object) 'PDO(driver == 'connects one thing to another') == class'
$db = new PDO("mysql:host=localhost;dbname=mediaLibrary;port=3306","root","evanetra");
//mysq... | true |
deb9b8bb9007052bf132caad933d0b345691f679 | PHP | hoangnguyen294/Module-2 | /Lop-va-doi-tuong-PHP/stopwatch/stopwatch.php | UTF-8 | 609 | 3.453125 | 3 | [] | no_license | <?php
class StopWatch {
private $startTime;
private $endTime;
function __construct() {
$this->startTime = microtime(true);
}
public function get_startTime(){
return $this->startTime;
}
public function get_endTime() {
return $this->endTime;
}
public functi... | true |
884f9e892a378ec8291532c3900c7812896f1bbb | PHP | skaut/Skautske-hospodareni | /app/model/Stat/ReadModel/QueryHandlers/EventStatisticsQueryHandler.php | UTF-8 | 1,413 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Model\Event\ReadModel\QueryHandlers;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\ParameterType;
use Model\Cashbook\Operation;
use Model\Event\ReadModel\Queries\EventStatisticsQuery;
use Model\Event\SkautisEventId;
use function array_map;
class EventStatisticsQueryHandle... | true |
834ad97833e11ecad5c9eba4a148b90e83397d08 | PHP | NicoRizz16/Terre-burkina | /src/AppBundle/Entity/News.php | UTF-8 | 4,220 | 2.515625 | 3 | [] | no_license | <?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* News
*
* @ORM\Table(name="news")
* @ORM\Entity(repositoryClass="AppBundle\Repository\NewsRepository")
*/
class News
{
const NUM_ITEMS = 10;
const NUM_ITEMS_ADMIN = 15;
/**... | true |
308a551181b880264dcf373ff69014f4afa75558 | PHP | prankul/searsgame | /sears/admin/coin_game.php | UTF-8 | 511 | 2.515625 | 3 | [] | no_license |
<?php
error_reporting(1);
session_start();
include_once("model/C91_Game_User.php");
$game_user = new C91_Game_User();
$timestamp = time();
$n = 10;
$cnt = array();
$loop = $n*$ppl;
$i=0;
while($n > $i){
$cnt[$i]... | true |
d943a8649d50ed6f86305ad0822cd7cf30789e38 | PHP | djgogo/CPCII | /Burger/tests/IngredientFactoryTest.php | UTF-8 | 1,080 | 2.90625 | 3 | [] | no_license | <?php
class IngredientFactoryTest extends PHPUnit_Framework_TestCase
{
/**
* @var IngredientFactory
*/
private $factory;
public function setUp()
{
$this->factory = new IngredientFactory();
}
/**
* @dataProvider provideInstance
* @param string $className
* @pa... | true |
10ec705d78d0cbf4d513ae2fe9b038a8a6036579 | PHP | BGCX261/zibo-svn-to-git | /trunk/zibo_modules/zibo.xmlrpc/src/zibo/library/xmlrpc/exception/ConnectionException.php | UTF-8 | 1,277 | 3.28125 | 3 | [] | no_license | <?php
namespace zibo\library\xmlrpc\exception;
use \Exception;
/**
* Exception thrown when a connection could not be opened
*/
class ConnectionException extends XmlRpcException {
/**
* Host to connect to
* @var string
*/
private $host;
/**
* Port to connect to
* @var integer
... | true |
925ff521027a44f5896231e84c094996e638ef7d | PHP | robbfountain/laravel-s3-migrate | /src/FileCollector.php | UTF-8 | 992 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace OneThirtyOne\S3Migration;
use Illuminate\Filesystem\FilesystemManager;
use Illuminate\Support\Collection;
/**
* Class FileCollector.
*/
class FileCollector
{
/**
* @var
*/
protected $files;
/**
* @var \Illuminate\Filesystem\FilesystemManager
*/
protected $fileSy... | true |
b4bddebe81b10dd46b0c37c3ce5041cb4abcccf9 | PHP | Saidalo/myProject | /controllers/login_controller.php | UTF-8 | 902 | 2.6875 | 3 | [] | no_license | <?php
class LoginController {
public function login() {
// we store all the posts in a variable
$posts = Post::all();
require_once('views/login/index.php');
}
public function show() {
// we expect a url of form ?controller=posts&action=show&id=x
// without an id we just redi... | true |
47631939570a65cf2e718a638fbfcda0fe0a9a7f | PHP | olegabr/qcubed_examples | /project/generated/model_base/PersonWithLockGen.class.php | UTF-8 | 34,076 | 2.734375 | 3 | [] | no_license | <?php
/**
* The abstract PersonWithLockGen class defined here is
* code-generated and contains all the basic CRUD-type functionality as well as
* basic methods to handle relationships and index-based loading.
*
* To use, you should use the PersonWithLock subclass which
* extends this PersonWithLockGen clas... | true |
84b372e4c75306e89bc684b8ab73333975648fad | PHP | gnueskob/WOR | /libs/DB.php | UTF-8 | 4,709 | 2.703125 | 3 | [] | no_license | <?php
namespace lsb\Libs;
use Exception;
use PDO;
use PDOException;
use PDOStatement;
use lsb\Config\Config;
define('DUPLICATE_ERRORCODE', '23000');
class DB extends Singleton
{
private $db = null;
private $transactionMode = 0;
protected function __construct()
{
parent::__construct();
... | true |
6153d1e96ab1b4596121f5fafa844c86785a1ec0 | PHP | jazzslider/zf-content | /forms/Post.php | UTF-8 | 2,766 | 2.515625 | 3 | [] | no_license | <?php
/**
* Distributable content module for Zend Framework
*
* This module is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
*... | true |
48c70898b1c753d8bcf5a53cbc87181cbde2a096 | PHP | grizz-it/micro-config | /src/Configuration/Configuration.php | UTF-8 | 958 | 2.90625 | 3 | [
"MIT"
] | permissive | <?php
/**
* Copyright (C) GrizzIT, Inc. All rights reserved.
* See LICENSE for license details.
*/
namespace GrizzIt\MicroConfig\Configuration;
use Exception;
class Configuration
{
private static array $config = [];
/**
* Retrieve a configuration value.
*
* @param string $key
*
... | true |
5e6c8649bb6512a8ba00cb016964f912add17436 | PHP | Josephx64/genesis | /inc/lstInformatica.php | UTF-8 | 1,563 | 2.65625 | 3 | [] | no_license | <?php
//Este módulo recupera muetra el listado de porducto de la categoria Informatica
//Consulta Recuperar productos de la categoria Informatica
$query_rsVwProductos = "SELECT * FROM vwProductos WHERE categoria = 'Informatica' ";
//RecordSet de la consulta
$rsVwProductos = mysql_query($query_rsVwProductos, $cxnSe... | true |
02e5db47455d61dc09658f08e07f6bed6a94d614 | PHP | dhalkin/JerkApi | /database/seeds/DanceBranchesSeeder.php | UTF-8 | 718 | 2.5625 | 3 | [] | no_license | <?php
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class DanceBranchesSeeder extends Seeder
{
private $branches = [
['Подол', 'Братская 6'],
['Виноградарь','проспект Правды 12в']
];
/**
* Run the database seeds.
*
* @return void
*/
public funct... | true |
c48420df548d8bf1a8de70c8753de3a05e17e2b2 | PHP | lostintime/php-lit-oauth2 | /src/Lit/OAuth2/Client.php | UTF-8 | 12,871 | 2.859375 | 3 | [
"MIT"
] | permissive | <?php
namespace Lit\OAuth2;
/**
* @package Lito\OAuth2
* @author lostintime
*/
class Client
{
/**
* @var string
*/
private $clientId;
/**
* @var string
*/
private $clientSecret;
/**
* @var string
*/
private $authorizationUri;
/**
* @var string
... | true |
461742b5d8e763cefbb624dda54ae8fa39b5df8d | PHP | rehfeldchris/wowarmory | /web/data.php | UTF-8 | 1,953 | 2.5625 | 3 | [] | no_license | <?php
header('content-type: text/plain');
require '../config.php';
$sql = "
select
c.guild_id,
c.guild_name,
ca.arenateam_id,
a.name arenateam_name,
count(*) num_connections
from denormalized_characters c
join character_arenateams ca
on c.id = ca.character_id
join arenateams a
on a.id = ca.arenateam_id
where g... | true |
4600ebaa300df946f76d098abb2ab4fd0b502abe | PHP | quekaihua/StudyTest | /PHP_Core_Technology_And_Best_Practice/5/5-3.php | UTF-8 | 680 | 2.796875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2015/12/28
* Time: 16:36
*/
function bindParam(&$sql,$location,$var,$type){
switch($type){
default:
case 'STRING':
$var = addslashes($var);
$var = "'".$var."'";
break;
case 'INTEGER':
... | true |
efb807de7571e88b14b615ac86de3c766e7eaaf6 | PHP | iamceejay/sentry | /application/controllers/Template.php | UTF-8 | 3,256 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
require_once APPPATH . 'libraries\REST_Controller.php';
class Template extends REST_Controller {
public function __construct() {
parent::__construct();
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
... | true |
a2f530fd2dd4ac1c116802aefefeb24ad92db073 | PHP | colinux/skNotesPlugin | /lib/skNotes.class.php | UTF-8 | 3,625 | 3.1875 | 3 | [
"MIT"
] | permissive | <?php
/**
* skNotesItem class representing a set of notes (references).
*
* @package skNotesPlugin
* @author Colin Darie <colindarie@gmail.com>
*/
class skNotes
{
/**
* @var array $instances Store all instances, indexed by instance name
*/
static protected $instances = array();
/**
* @var array $n... | true |
04a4626c40a41841cd95b4c0b767e0741a57e655 | PHP | shenlongb/phphut | /3130/includes/data.inc.php | UTF-8 | 1,842 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | <?php
function remove_remarks( $sql )
{
$i = 0;
while ( $i < strlen( $sql ) )
{
if ( $sql[$i] == "#" && ( $i == 0 || $sql[$i - 1] == "\n" ) )
{
$j = 1;
while ( $sql[$i + $j] != "\n" )
{
$j++;
if ( strlen( $sql ) < $j + $i )... | true |
cbfe95c36b79c2cf0117eeeff35ed004f8c2dfdf | PHP | ashenud/ihms | /database/migrations/2020_10_15_185953_create_vaccine_dates_table.php | UTF-8 | 1,003 | 2.578125 | 3 | [] | no_license | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateVaccineDatesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('vaccine_da... | true |
585d7638dc7eb448152a84ffb4a58d44786d16fc | PHP | touki653/console-colors | /src/Touki/ConsoleColors/Color/None.php | UTF-8 | 380 | 2.609375 | 3 | [] | no_license | <?php
namespace Touki\ConsoleColors\Color;
use Touki\ConsoleColors\ColorInterface;
/**
* None Color
*
* @author Touki <g.vincendon@vithemis.com>
*/
class None implements ColorInterface
{
/**
* {@inheritDoc}
*/
public function getName()
{
return 'none';
}
/**
* {@inheri... | true |
aa6fd1790ff9c95176c6c4960fdfbed365d6c285 | PHP | HeleneLevry/WebEDI | /Transactions/connection.php | UTF-8 | 3,524 | 2.515625 | 3 | [] | no_license | <!-- connection.php -->
<!--?php require "session.php" ?-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="style.css" />
<title>Web-EDI - Log in</title>
</head>
<body>
<div class="colonneBody">
<!-- Title -->
<h1>Log in</h1>
<hr>
<!-... | true |
9712f8752924f9267b19cdcc9039a815434c6aed | PHP | vernar/homeworks | /lessons/lesson5dop.php | UTF-8 | 279 | 3.53125 | 4 | [] | no_license | <?php
$result = [];
for ($x = 1; $x < 100; $x++ ){
for($y = 2; $y < $x && $x % $y != 0; $y++ ){
}
if ($x == $y){
$result[] = $x;
}
}
foreach ($result as $key => $value) {
echo "<p>$value - это простое число № " . ($key+1) ." </p>";
} | true |
6c52ee3ed8651fa8a719e6e7831387fdba028ff2 | PHP | AntoninaSych/parser | /app/Http/LogicalModels/CountryLogicalModel.php | UTF-8 | 449 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\LogicalModels;
use App\Http\Models\Country;
class CountryLogicalModel
{
public function save(string $countryCode): Country
{
$country = Country::where('name', $countryCode)->first();
if (is_null($country)) {
Country::firstOrCreate(['name' => $countryCo... | true |
34f17fb825717aa49185ae8ebf88d5506125a99f | PHP | scriptonius/php-master_blog | /app/Core/DBDriver.php | UTF-8 | 3,032 | 2.875 | 3 | [] | no_license | <?php
namespace NTSchool\Phpblog\Core;
use NTSchool\Phpblog\Core\Exceptions\Fatal;
class DBDriver
{
use Traits\Singleton;
/**
* @var \PDO
*/
protected $db;
/**
* DBDriver constructor.
*/
public function __construct()
{
$opt = [
\PDO::ATTR_ERRMODE => ... | true |
fb47fc34fdfa02b74c9cd2415cfd78f19a773f3d | PHP | BGCX261/zibo-svn-to-git | /tags/0_9_4/zibo_modules/joppa.podcasts/src/joppa/podcast/model/mapper/PodcastMapper.php | UTF-8 | 2,196 | 2.90625 | 3 | [] | no_license | <?php
namespace joppa\podcast\model\mapper;
use joppa\model\content\mapper\AbstractOrmContentMapper;
use joppa\model\content\Content;
use joppa\podcast\model\PodcastModel;
use joppa\search\model\mapper\SearchableContentMapper;
/**
* Content mapper for a podcast
*/
class PodcastMapper extends AbstractOrmContentM... | true |
6a50808dcbf41455eed3226fa8e862ee3c8091c9 | PHP | wellsoterio/api_php | /index.php | UTF-8 | 332 | 2.734375 | 3 | [] | no_license |
<?php
require_once __DIR__ ."/src/model/produto.php";
require_once __DIR__ . "/src/controller/ProdutoController.php";
$p1 = new produto(1, "joelho", 0.85, "material de construção com curva de 90 graus", 10, "exemplo/imagemexemplo.png");
$Controlador = new ProdutoController();
$Controlador->inserirProduto($p1);
ech... | true |
d9410692fba69d9f807ccf67b6ffaf9aecc2d51e | PHP | siberfx/laravel-telegram-bot | /src/Update.php | UTF-8 | 2,356 | 3.234375 | 3 | [
"MIT"
] | permissive | <?php
namespace SumanIon\TelegramBot;
use stdClass;
class Update extends stdClass
{
/**
* Parse update data.
*
* @param mixed $update
*/
public function __construct($update)
{
$this->fromString($update);
$this->fromObject($update);
$this->fromArray($update);
... | true |