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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
f09bc915fa4fc24de609697fbc35523546ee39e5 | PHP | sakurahigashi2/baht | /wordpress/wp-content/plugins/w3-total-cache/lib/Minify/Minify/Inline.php | UTF-8 | 2,835 | 2.703125 | 3 | [
"GPL-1.0-or-later",
"GPL-2.0-or-later",
"GPL-2.0-only",
"MIT"
] | permissive | <?php
abstract class Minify_Inline {
protected $_tag = '';
protected $_minifier = null;
protected $_minifierOptions = array();
//abstract static function minify($content, $minifier, $options = array());
public function setTag($tag) {
$this->_tag = $tag;
}
public function setMinif... | true |
b2c06aa3ede410cb23d567d696ffa28557ff3e2e | PHP | schematical/MCAD | /_core/3d/MCADCubeObject.class.php | UTF-8 | 173 | 2.609375 | 3 | [] | no_license | <?php
class MCADCubeObject extends MCAD3DObjectBase{
public function RenderProps(){
return sprintf(
'[%s, %s, %s]',
$this->x,
$this->y,
$this->z
);
}
} | true |
bd0955b1387224ae2124ad88ecf4873682fd1f26 | PHP | isilnieks/codelex | /Second-Homework/Loops/1/05.php | UTF-8 | 597 | 3.65625 | 4 | [] | no_license | <?php
echo "Welcome to piglet!\n";
$score = 0;
do {
$randomNumber = rand(1, 6);
if ($randomNumber == 1) {
echo 'You rolled a 1!' . PHP_EOL . 'You got 0 points' . PHP_EOL;
exit;
} else {
echo "You rolled $randomNumber\n";
$toContinue = readline('Roll again? (y/n)')... | true |
9ad37089dff2866221eded4bcc020aeae6ba63bb | PHP | war-datasets/AAD-client | /app/Contact.php | UTF-8 | 646 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
/**
* An eloquent model: 'Contact'
*
* @property integer $id The primary key.
* @property string $title The title from the message.
* @property string $message The contact message (body).
* @property... | true |
a135c4b835494c87e1829dd50a80af04fadd8b66 | PHP | MolMeDB/MolMeDB | /application/libraries/Pubchem.php | UTF-8 | 12,416 | 2.90625 | 3 | [] | no_license | <?php
/**
* Pubchem api handler
*/
class Pubchem extends Identifier_loader
{
/** Holds connection */
private $client;
/** STATUS */
private $STATUS = false;
/** Data holder */
private $data = [];
/** Holds info about last used identifier type */
public $last_identi... | true |
23e9fdc7abb9e2f986ec93c10d3fcc447e6f18d8 | PHP | daschl/li3_fixtures | /tests/cases/test/FixtureTest.php | UTF-8 | 5,485 | 2.546875 | 3 | [] | no_license | <?php
/**
* li3_fixtures: Enrich your testing data with fixtures
*
* @copyright Copyright 2012, Michael Nitschinger (http://nitschinger.at)
* @license http://opensource.org/licenses/bsd-license.php The BSD License
*/
namespace li3_fixtures\tests\cases\test;
use li3_fixtures\test\Fixture;
/**
* Tests ... | true |
9d9923f6d66fb227c7ee70e72e1e2e6bb8901448 | PHP | castion2293/zhoker | /app/Services/CreditCardService.php | UTF-8 | 2,636 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Services;
use App\Repositories\UserRepository;
use App\Repositories\CreditCardRepository;
use Stripe\Stripe;
use Stripe\Customer;
use Stripe\Charge;
class CreditCardService
{
protected $userRepo;
protected $creditCardRepo;
protected $creditCard;
protected $customer;
/**
... | true |
f522e57bf47949f4428d25c084fc23bcd1501114 | PHP | dlaststark/machine-learning-projects | /Programming Language Detection/Experiment-2/Dataset/Train/PHP/sorting-algorithms-quicksort-2.php | UTF-8 | 594 | 3.234375 | 3 | [] | no_license | function quickSort(array $array) {
// base case
if (empty($array)) {
return $array;
}
$head = array_shift($array);
$tail = $array;
$lesser = array_filter($tail, function ($item) use ($head) {
return $item <= $head;
});
$bigger = array_filter($tail, function ($item) use ($... | true |
5c25c35f09b5e7788350dacd97cbafe7b704f00f | PHP | zerospam/laravel-gettext | /tests/unit/TranslationTest.php | UTF-8 | 3,647 | 2.609375 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: aaflalo
* Date: 17-08-01
* Time: 10:22
*/
namespace unit;
use Xinax\LaravelGettext\Adapters\LaravelAdapter;
use Xinax\LaravelGettext\Config\ConfigManager;
use Xinax\LaravelGettext\FileSystem;
use Xinax\LaravelGettext\Storages\MemoryStorage;
use Xinax\LaravelGettext\Testin... | true |
a4c050ad1b7ebfb9987f675975e1ab8540cd9b5b | PHP | khiemdoan/eLearning | /framework/database.php | UTF-8 | 1,021 | 2.71875 | 3 | [] | no_license | <?php
namespace Framework {
use Framework\Base as Base;
use Framework\Exception as Exception;
class Database extends Base {
protected $type = 'mysqli';
public function initialize() {
$config = Registry::get('config');
if ($config) {
$config = $con... | true |
3add6748b5fc6f7ed5d7f91f5ae54c3294a4c0ce | PHP | quafzi/php-compat-info | /PHP/CompatInfo/Reference/core.php | UTF-8 | 18,536 | 2.6875 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/**
* Version informations about components always available with PHP
*
* PHP version 5
*
* @category PHP
* @package PHP_CompatInfo
* @author Laurent Laville <pear@laurent-laville.org>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version GIT: $Id$
* @link http:/... | true |
3e36d88c27994a9e073aa241b6e43728030a7c09 | PHP | jilljenn/trashadvisor | /traitement_ville.php | UTF-8 | 1,654 | 2.828125 | 3 | [] | no_license | <?php
require("connections/mysql.php");
?>
<?php
//if (isset($_GET['maVariable'])) { echo $_GET['maVariable'];};
//if (isset($_GET['codepostal'])) { echo $_GET['codepostal'];};
?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic... | true |
4746397c422aea247568bceee69b52df0648d819 | PHP | andrea-gasparini/progetto-linguaggi-tecnologie-web | /back-end/server/application/controllers/SearchUserController.php | UTF-8 | 958 | 2.640625 | 3 | [] | no_license | <?php
class SearchUserController extends \chriskacerguis\RestServer\RestController
{
public function __construct($config = 'rest')
{
parent::__construct($config);
}
public function searchUser_post()
{
// l'utente dev'essere loggato per cercare.
$tokenData = validateAuthorizationToken($this->input->get_re... | true |
6ca8b14f51950ab4e93a20ae57f0efaa8d511327 | PHP | nguyenvanduocit/cognalys-phone-verify | /src/ClientInterface.php | UTF-8 | 363 | 2.546875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 04/17/15
* Time: 6:01 AM
*/
namespace Cognalys;
interface ClientInterface {
/**
* @param $phone_number
* @return string keymatch
*/
public function otp_call($phone_number);
/**
* @param $otp
* @return mixed
... | true |
fd64ac2ea31def4b88bed8367b3ad3a082c3fb5e | PHP | albertocubeddu/variousSnippets | /phpSnippets/phpSPL/heap.php | UTF-8 | 1,526 | 3.546875 | 4 | [] | no_license | <?php
/*
SplMaxHeap/SqlMinHeap extends SplHeap implements Iterator , Countable.
Description of a max heap:
A max-heap is a complete binary tree in which the value in each internal node is greater than or equal to the values in the children of that node.
The root node is always greater than other node in the tree... | true |
6667d80e11dcd2a54f5cc6d275d10c144b3c03dc | PHP | LEmanRUS17/Triangle-website-on-Yii2 | /modules/user/forms/frontend/EmailConfirm.php | UTF-8 | 1,654 | 2.875 | 3 | [] | no_license | <?php
namespace app\modules\user\forms\frontend;
use app\modules\user\Module;
use app\modules\user\models\User;
use yii\base\InvalidArgumentException;
class EmailConfirm // Подтверждение электронной почты
{
private $_user; // Переменная для хранения пользователя
/**
* @param string $token
* @param ... | true |
615fae429c3bff4c3da6814197d1704c5a9b8b10 | PHP | lucianogithub/cursophp7-dao | /index.php | UTF-8 | 890 | 2.75 | 3 | [] | no_license | <?php
require_once("config.php");
// CARREGA UM USUÁRIO
// $root = new Usuario();
// $root->loadById(4);
// echo $root;
// CARREGA UMA LISTA
// $lista = Usuario::getList();
// echo json_encode($lista);
// CARREGA UMA LISTA DE USUARIOS BUSCANDO PELO LOGIN
// $search = Usuario::search("g");
// echo json_encode($sea... | true |
87da21a32da3f7dcc97c9399e4f3bc71091f9f68 | PHP | semisalov/fix-cms-core | /src/Helpers/ImagesInterface.php | UTF-8 | 1,624 | 2.65625 | 3 | [] | no_license | <?php
namespace AltSolution\Admin\Helpers;
use Illuminate\Http\Request;
use Illuminate\Http\UploadedFile;
interface ImagesInterface
{
/**
* Save image in storage
* @param string $property Image field
* @param $file
* @throws \Exception
*/
function imageSave($property, UploadedFile $f... | true |
82610e32f8126ae35228445f1d238d849ff355f2 | PHP | razvanef/bachelor-degree-project | /api/v1/guestsreport.php | UTF-8 | 555 | 2.625 | 3 | [] | no_license | <?php
require_once("dbHandler.php");
$db = new DbHandler();
$result = $db->getAllRecords("SELECT user_name, email FROM event_guests");
require('fpdf/fpdf.php');
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(40, 12, "No", 1);
$pdf->Cell(75, 12, "Name", 1);
$pdf->Cell(75, 12, "Email", ... | true |
104a9415037ede299725e6321f5ad969922193c0 | PHP | IvanLuLyf/NeoCenter | /TwimiPHP/View.php | UTF-8 | 2,208 | 2.828125 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: IvanLu
* Date: 2018/1/1
* Time: 15:01
*/
class View
{
protected $variables = array();
protected $_controller;
protected $_action;
protected $_mode;
function __construct($controller, $action, $mode = 0)
{
$this->_controller = strtolower($con... | true |
43381f196d303bb574131d3f0aa5308a50e20f24 | PHP | htnamdd/congly | /application/includes/zone.php | UTF-8 | 2,707 | 2.828125 | 3 | [] | no_license | <?php
// CLass Zone
require_once UTILS_PATH.'cache.file.php';
class Zone extends DatabaseObject
{
public $cachePath;
function __construct()
{
if (!is_dir(CACHE_FILE_PATH.'zone/'))
mkdir(CACHE_FILE_PATH.'zone/', 0777);
$this -> cachePath = CACHE_FILE_PATH.'zone/';
$this->databaseName = 'com';
}
/**
* L... | true |
035f5996f120124ae4e4a0c0627822575c0a2b2c | PHP | yoshua9/bags-kata | /src/Domain/Exceptions/NotValidBagCategoryException.php | UTF-8 | 269 | 2.75 | 3 | [] | no_license | <?php
namespace BagsKata\App\Domain\Exceptions;
class NotValidBagCategoryException extends \Exception
{
public function __construct(string $categoryName)
{
parent::__construct(sprintf('%s is not a valid category for the bag', $categoryName));
}
} | true |
9a303a8404f164265e5788598b4d52af8f2be114 | PHP | alejandrososa/PatronesDiseno | /construccion/prototype/index.php | UTF-8 | 897 | 2.828125 | 3 | [] | no_license | <?php
/**
* Creado con PhpStorm.
* patronesdiseno
* Desarrollador: Alejandro Sosa
* Fecha: 5/10/2016
* Hora: 20:24
*/
namespace Prototype;
require_once 'DocumentacionEnBlanco.php';
require_once 'OrdenDePedido.php';
require_once 'CertificadoCesion.php';
require_once 'SolicitudMatriculacion.php';
require_once... | true |
05e53adcd64d40d70abb82f243966a85fdc78650 | PHP | tsolucio/corebos | /include/antlr/ANTLRStringStream.php | UTF-8 | 3,970 | 3.0625 | 3 | [] | no_license | <?php
CharStreamConst::$EOF = -1;
class ANTLRStringStream implements CharStream {
/** Copy data in string to a local char array */
public function __construct($input) {
$this->p=0;
$this->line = 1;
$this->charPositionInLine = 0;
$this->markDepth = 0;
$this->markers = null;
$this->lastMarker=0;... | true |
2ba920338f2a3ff7ff3bfd6283566bfb1b047550 | PHP | flavienbwk/mobcamp | /api/app/OrderUserItem.php | UTF-8 | 609 | 2.546875 | 3 | [] | no_license | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class OrderUserItem extends Model
{
protected $table = "order_user_item";
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'order_id',
'cooperative_id',
'user... | true |
1f15d390b0762c81646ef7f807f3533545d6d97c | PHP | c9s/AssetKit | /src/Exception/UnknownFragmentException.php | UTF-8 | 266 | 2.734375 | 3 | [] | no_license | <?php
namespace AssetKit\Exception;
use Exception;
class UnknownFragmentException extends Exception {
public $fragment;
public function __construct($message, $fragment) {
$this->fragment = $fragment;
parent::__construct($message);
}
}
| true |
49dd7e30385d7884aff5f697dae480c1c8b69695 | PHP | PAT19999/PlanAndTravel | /php/registrazione.php | UTF-8 | 4,663 | 2.5625 | 3 | [] | no_license | <?php
include_once '../includes/db_connection.php';
if ($_SERVER['REQUEST_METHOD'] === "POST") {
if (isset($conn)) {
$password = $conn->real_escape_string($_POST['password']);
$passConfirm = $conn->real_escape_string($_POST['passConfirm']);
// controlla che passConfirm corrisponda a passwo... | true |
f2f2c7e3ac45bbc5343a2e32aafa2e170294531e | PHP | rackerlabs/sdk_workshops | /PHP/compute/main.php | UTF-8 | 2,620 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | <?php
//
// 1. Create client
//
require 'vendor/autoload.php';
use OpenCloud\Rackspace;
use OpenCloud\Compute\Constants\Network;
use OpenCloud\Common\Constants\State;
$client = new Rackspace(Rackspace::US_IDENTITY_ENDPOINT, array(
'username' => getenv('RAX_USERNAME'),
'apiKey' => getenv('RAX_API_KEY')
));
... | true |
31c14c7dfe64d70dc8b2e22df941dbec4c3a2959 | PHP | kiang/elections | /Plugin/Permissible/View/Helper/PHtmlHelper.php | UTF-8 | 5,495 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
App::import('Helper', 'Html');
require_once App::pluginPath('Permissible') . 'Config/init.php';
/**
* Permissible Plugin PHtml Helper class
*
* Add ACL checking to links
*
* @package permissible
* @subpackage permissible.views.helpers
*/
class PHtmlHelper extends HtmlHelper
{
/**
* The session key name wh... | true |
341acc6c44f7cbfa1db99c1091563539d7b309eb | PHP | laancaro/ISI-BSI-19_I-2019 | /examen2/register.php | UTF-8 | 7,019 | 3 | 3 | [] | no_license | <?php
// Include config file
require_once "../examen2/config/config.php";
require_once "criptarca.php";
// Define variables and initialize with empty values
$nombre =$email =$telefono =$nick = $password = $confirm_password = "";
$nombre_err =$email_err =$telefono_err =$nick_err = $password_err = $confirm_password_err =... | true |
bb860a2cc32d1bb57d08671a36405e90834c4161 | PHP | UndefinedOffset/silverstripe-restrictedurlsegments | /code/RestrictedURLSegments.php | UTF-8 | 745 | 2.515625 | 3 | [] | no_license | <?php
class RestrictedURLSegments extends DataExtension {
/**
* Segments that are restricted
* @var {array}
* @config RestrictedURLSegments.restricted
*/
private static $restricted=array(
'dev',
'admin'
... | true |
6e03a1199dfdd4622baba5c740996464ffbfb449 | PHP | ministryofjustice/opg-lpa | /shared/module/MakeShared/src/Telemetry/Event.php | UTF-8 | 945 | 2.640625 | 3 | [
"LicenseRef-scancode-proprietary-license",
"MIT"
] | permissive | <?php
namespace MakeShared\Telemetry;
use Laminas\EventManager\Event as LaminasEvent;
use Laminas\EventManager\EventInterface as LaminasEventInterface;
/** @psalm-suppress MissingTemplateParam */
class Event extends LaminasEvent
{
private ?string $segmentName;
private array $attributes = [];
public fun... | true |
e1e8489dc8195cf55cb5e17ed614f01a679d6fa8 | PHP | itsnilay/studentbooks10 | /akm/Includes/db.php | UTF-8 | 2,416 | 3.265625 | 3 | [] | no_license | <?php
class WishDB {
// single instance of self shared among all instances
private static $instance = null;
// db connection config vars
private $user = "andrew";
private $pass = "3dcrsec0";
private $dbName = "andrew";
private $dbHost = "hci.cs.sfsu.edu";
private $con = null;
// p... | true |
d322e91eadcef58b168a2bdf658e2ce62dd774f9 | PHP | ElleHaime/ew-phalconcore | /lib/Engine/Crud/Grid/Filter/Field/Between.php | UTF-8 | 1,444 | 2.859375 | 3 | [
"MIT"
] | permissive | <?php
/**
* @namespace
*/
namespace Engine\Crud\Grid\Filter\Field;
use Engine\Filter\SearchFilterInterface as Criteria,
Engine\Crud\Container\AbstractContainer as Container;
/**
* Grid filter field
*
* @category Engine
* @package Crud
* @subpackage Grid
*/
class Between extends Standa... | true |
0e629508f17fbfa528b18ee738c9a7efa3a9854a | PHP | caseyamcl/sortable-tasks | /src/SortableTask.php | UTF-8 | 1,001 | 2.96875 | 3 | [
"MIT"
] | permissive | <?php
/**
* Sortable Tasks Library
*
* @license http://opensource.org/licenses/MIT
* @link https://github.com/caseyamcl/sortable-tasks
* @version 1
* @package caseyamcl/sortable-tasks
* @author Casey McLaughlin <me@caseymclaughlin.com>
*
* For the full copyright and license information, please view the LICENS... | true |
8f96bec993befa1b0b7e3044532400a624ac512d | PHP | betovicentini/duckewiki2 | /www/duckewiki/model/tax.php | UTF-8 | 1,509 | 2.6875 | 3 | [] | no_license | <?php
class Taxon{
public $usuario;
public $data;
public $nome;
public $rank;
public $pai;
public $valid;
public $especialista;
public $autor;
public $autortxt;
public $ano;
public $idadeCrown;
public $idadeTem;
public $valbib;
public $bibtxt;
public $reposid;
public $repostxt;
//construtor da classe
... | true |
f726139de933ee3dee70dd63650ea9ddb6c6e93e | PHP | stailer/phpservices-silverlight | /php-services/Autoloader.php | UTF-8 | 186 | 2.578125 | 3 | [] | no_license | <?php
// paramétrage des classes en autochargement
function __autoload($class_name) {
$class_name = str_replace('_', '/', $class_name);
require_once $class_name . '.php';
} | true |
7bae02cc95ab28dc8ed31e7e4970681233ce1cc6 | PHP | jtl-scx/api-base-client | /src/Request/UrlFactory.php | UTF-8 | 1,138 | 2.921875 | 3 | [
"MIT"
] | permissive | <?php declare(strict_types=1);
/**
* This File is part of JTL-Software
*
* User: pkanngiesser
* Date: 2019/09/23
*/
namespace JTL\SCX\Client\Request;
use GuzzleHttp\UriTemplate\UriTemplate;
class UrlFactory
{
/**
* @param string $host
* @param string $url
* @param array $params
* @return... | true |
98bd5e3591376cd1e9d0a554bfa171cb35e1b09c | PHP | SamFantasy/A3 | /Asgmt3.php | UTF-8 | 1,296 | 3.5625 | 4 | [] | no_license | <?php
/*
Samuel Bui
Assignment 3
Due: Wednesday @ 11:59pm
Create an array with your info. $array [] = ("Samuel", "Bui","11/16/1988")
Hint" create an array with key.
Populate a Person and Address object with your info from the array.
Print out the contents of the array.
Create two MySql tables with your info. (... | true |
8c25619c4096a50ec76aed814db6f4216897480f | PHP | sungmee/laravel-fx | /src/GatewayInterface.php | UTF-8 | 587 | 2.84375 | 3 | [] | no_license | <?php
namespace Sungmee\LaraFX;
interface GatewayInterface
{
/**
* 获取最新汇率
*
* @param string $base 汇率基础货币
* @param string $symbols 需要查询的货币种类,多个种类用英文逗号隔开
* @param int $minutes 缓存时间,单位秒
* @return object
*
* Return Example
* stdClass Object (
* [base] => USD
* [... | true |
8d7c4e9e317e60888b8a94fa21b5bbdc870814b5 | PHP | easybiblabs/api-client-php | /tests/EasyBib/Tests/Api/Client/ApiResource/RelationsContainerTest.php | UTF-8 | 2,760 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace EasyBib\Tests\Api\Client\Resource;
use EasyBib\Api\Client\ApiResource\Relation;
use EasyBib\Api\Client\ApiResource\RelationsContainer;
class RelationsContainerTest extends \PHPUnit_Framework_TestCase
{
/**
* @return array
*/
public function getRelationsData()
{
return [
... | true |
eb959b43cf92f5a4ce6b106f37b50950fdbffe45 | PHP | MargaritaKhabalova/laravel2 | /app/Http/Controllers/HopeController.php | UTF-8 | 894 | 2.75 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Hop;
class HopeController extends Controller
{
public function getHopes()
{
$hope = Hop::get();
return response()->json($hope);
}
public function addHopes(Request $req)
{
$hope = new Hop();
$hope->nam... | true |
13ebc41b40a1ddebc69276d0655a4be1bbae9295 | PHP | caseyamcl/openapi-params | /src/Model/ParameterValidationRule.php | UTF-8 | 1,955 | 2.765625 | 3 | [
"MIT"
] | permissive | <?php
/**
* OpenApi-Params Library
*
* @license http://opensource.org/licenses/MIT
* @link https://github.com/caseyamcl/openapi-params
*
* @author Casey McLaughlin <caseyamcl@gmail.com>
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this s... | true |
ee372dc5de8895b3d388989ad9384e473877ae00 | PHP | Joe3Huang/IoTCarTracking | /RestApi/app/Repository/DeviceRepository.php | UTF-8 | 3,534 | 2.703125 | 3 | [] | no_license | <?php
namespace App\Repository;
use App\Device;
use App\Models\UserDeviceLink;
use Illuminate\Support\Facafes\Hash;
use Illuminate\Support\Facades\Auth;
use App\Library\Services\UuidInterface;
use Carbon\Carbon;
class DeviceRepository{
protected $uuidService;
public function __construct(UuidInterface $uuid... | true |
6845f7a6488c98c9f50c87f41ce271a7496270cb | PHP | rashardhinds/RIEPSScript | /Frontend/status_update.php | UTF-8 | 881 | 2.578125 | 3 | [] | no_license | <?php
//Updates the status of each server in the Database so data isnt sent to the same server while its processing...
//Each server has its own ID which must be configured on each server
require("dbcon.php");
$busy = $_GET['busy'];
$id = $_GET['id'];
//usage: http://FRONTEND-STIE-HERE/status_update.php?id=1&busy=0
... | true |
cacf34f9e6c2bfe3195299c4753ebec0e9b2c8c1 | PHP | alzca1/coordinates-II | /private/query_functions.php | UTF-8 | 807 | 2.609375 | 3 | [] | no_license | <?php function insert_restaurant($restaurant){
global $db;
$sql = "INSERT INTO restaurants ";
$sql .= "(name,address, lat, lng, kind_food) ";
$sql .= "VALUES (";
$sql .= "'" . $restaurant['name'] . "',";
$sql .= "'" . $restaurant['address'] . "',";
$sql .= "'" . $restaurant['lat'] . "',"... | true |
2fb7e6f7c4b8a0205aacfa7e0ac6831e7ed16584 | PHP | marcoszf/Codengage-Teste | /app/Entities/Product.php | UTF-8 | 2,065 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Entities;
use Doctrine\ORM\Mapping AS ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity
* @ORM\Table(name="product")
*/
class Product
{
/**
* @var \Ramsey\Uuid\UuidInterface
*
* @ORM\Id
* @ORM\Column(type="string", unique=true)
* @ORM\Generated... | true |
5cc3bd2157663d89e916d33652ff8d39bbd7ec14 | PHP | shohei1113/salon | /app/Services/CategoryService.php | UTF-8 | 2,765 | 2.734375 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace App\Services;
use App\Entities\Category;
use App\Entities\Image;
use App\Repositories\Category\CategoryRepository;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\DB;
use Exception;
/**
* Class CategoryService
* ... | true |
6445c18d7ae6349fbb586edb64a92e230ea087f1 | PHP | Berson1990/alkhadel | /app/Http/Models/Suppliers.php | UTF-8 | 3,031 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php namespace App\Http\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Validator;
class Suppliers extends Model{
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'tblSuppliers';
/**
* The attribut... | true |
e38dddac6279d3fae9d495476d13de1ce8d33056 | PHP | flavio121996/tugas_teknologi_web | /tambah.php | UTF-8 | 1,355 | 3.15625 | 3 | [] | no_license | <?php
//inlcude atau memasukkan file koneksi ke database
include "koneksi.php";
if(isset($_POST['submit'])){
// menangkap data yang di kirim dari form
$nama_mhs = $_POST['nama_mhs'];
$nim = $_POST['nim'];
$alamat = $_POST['alamat'];
//melakukan query dengan perintah INSERT INTO untuk... | true |
b99d5e243374fa095debaf832819971f70f74a41 | PHP | mckenro/php-template | /tests/ClassTest.php | UTF-8 | 434 | 3.125 | 3 | [
"MIT"
] | permissive | <?php
require_once "src/Class.php";
class ClassTest extends PHPUnit_Framework_TestCase
{
function myFunction()
{
//Arrange
$test_TitleCaseGenerator = new Class;
$input = "beowolf";
//Act
$result = $test_TitleCaseGenerator->makeT... | true |
a768c11d39f42e9f12901c220ca858573d51648d | PHP | wangjingyuwangjingyu/wangjingyu | /老师写的php后台代码/libs/sql.class.php | UTF-8 | 528 | 3 | 3 | [] | no_license | <?php
class sql{
function __construct()
{
$this->connect = new mysqli(HOST,USERNAME,PASSWORD,DBNAME,PORT);
$this->setCharset(CHARSET);
}
function setCharset($charset){
$this->connect->set_charset($charset);
}
function query($sql){
return $this->connect->query($sql... | true |
992a93e784a61611029474955927f10d8bd2524f | PHP | cyimena09/egames | /views/game_list.php | UTF-8 | 901 | 2.609375 | 3 | [] | no_license | <?php
$games = getGamesByNbPlayers();
$i=0;
?>
<h2>Liste des jeux</h2>
<div style="margin-left: 25%">
<a href="game_add.php">Ajouter un jeu</a>
<table class="table table-dark col-8">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Nom du jeu</th>
<th scop... | true |
34864e3592f2aa27fefbbc92781122439e7a467d | PHP | AgenceStratis/migrator | /src/Processor/UpperCaseProcessor.php | UTF-8 | 337 | 2.75 | 3 | [] | no_license | <?php
namespace Stratis\Component\Migrator\Processor;
/**
* Class UpperCaseProcessor
* @package Stratis\Component\Migrator\Processor
*/
class UpperCaseProcessor extends Processor
{
/**
* @param string $text
* @return string
*/
public static function exec($text)
{
return strtouppe... | true |
5e5ab89204f3f73a9180c01e85d30e0a1ccd4272 | PHP | Stolz/php-stubs | /res/php/pthreads/stackable.php | UTF-8 | 1,159 | 2.9375 | 3 | [
"Apache-2.0",
"CC-BY-3.0"
] | permissive | <?php
/** @phpstub */
class Stackable
{
/**
* Identification
*
* @return long A numeric value representing the identity of the creating context
*/
public function getCreatorId()
{
}
/**
* Identification
*
* @return long A numeric value, which can be used within a... | true |
052b1a1ebb54223a4cc7d361137e0fa60e95ade5 | PHP | anthowen/laravel-admin | /app/Http/Controllers/EmployeesController.php | UTF-8 | 2,306 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php namespace App\Http\Controllers;
use App\Http\Middleware\VerifyCsrfToken;
use App\Http\Requests\StoreEmployeeRequest;
use App\Models\Companies;
use App\Models\Employees;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
class EmployeesController extends Controller {
/**
* Display a listing of t... | true |
9a95b356e7a373abe367cc99195eedabdbed77f3 | PHP | vault123/hexagonal-architecture-example | /src/Oven/CheapoOven.php | UTF-8 | 675 | 3.015625 | 3 | [
"MIT"
] | permissive | <?php
/**
* @author James Mannion <mannion007@gmail.com>
*/
namespace Mannion007\WaffleFactory\Oven;
use Mannion007\WaffleFactory\Model\Waffle;
use Mannion007\WaffleFactory\Model\WaffleBatter;
class CheapoOven implements OvenInterface
{
/** @var int $watts */
private $watts = 250;
public function bake... | true |
4e2d2d90b840af178577667721bb72c06c093498 | PHP | RNNikolov/Blog | /app/Http/Controllers/DashboardController.php | UTF-8 | 1,016 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use App\Models\Post;
use Session;
class DashboardController extends Controller
{
public function __construct() {
$this->middleware('can:manage-posts-comments');
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
... | true |
cbcbb962ce8a2b2c7ddfbc6c5609fb6564099024 | PHP | alfrededison/HeadFirst-Design-Pattern-in-PHP | /Ch07+ - Facade Pattern/Amplifier.php | UTF-8 | 1,256 | 3 | 3 | [] | no_license | <?php
/**
* User: isaac
* Date: 14/02/2018
* Time: 3:50 PM
*/
namespace Headfirst;
class Amplifier
{
/** @var Tuner $tuner */
protected $tuner;
/** @var DvdPlayer $dvdPlayer */
protected $dvdPlayer;
/** @var CdPlayer $cdPlayer */
protected $cdPlayer;
public function on()
{
... | true |
fe5b71c385e29c90e574b3bbb057e43086682ee7 | PHP | dr3wid/deepzoom.php | /src/Deepzoom/ImageAdapter/Imagick.php | UTF-8 | 3,643 | 2.828125 | 3 | [] | no_license | <?php
namespace Deepzoom\ImageAdapter;
use Deepzoom\StreamWrapper\StreamWrapperInterface;
/**
* Deep Zoom Tools
*
* Copyright (c) 2008-2010, OpenZoom <http://openzoom.org/>
* Copyright (c) 2008-2010, Nicolas Fabre <nicolas.fabre@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, ... | true |
9751d200638019350c878347f5e78b400d71b64f | PHP | elinoretenorio/php-headless-crud-for-inventory-db | /tests/src/Suppliers/SuppliersModelTest.php | UTF-8 | 1,795 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Inventory\Tests\Suppliers;
use PHPUnit\Framework\TestCase;
use Inventory\Suppliers\{ SuppliersDto, SuppliersModel };
class SuppliersModelTest extends TestCase
{
private array $input;
private SuppliersDto $dto;
private SuppliersModel $model;
protected functio... | true |
f3721d717d344369bc6d0775a87a88db87eefc2c | PHP | PatrickLamoureux01/353MainProject | /Model/health_workers.php | UTF-8 | 2,791 | 2.671875 | 3 | [] | no_license | <?php
function create_health_worker($medicare,$adm,$link) {
$pass = "7c4a8d09ca3762af61e59520943dc26494f8941b"; // default 123456
$sql = "INSERT INTO publicHealthWorker(workerId,password,isAdmin) VALUES(?,?,?)";
$insert_stmt = mysqli_prepare($link, $sql);
mysqli_stmt_bind_param($insert_stmt, 'isi', $... | true |
cbd4238fc63c6cb3769ede028def1bc1a8831e7f | PHP | qibaba123/zufang | /libs/mysql/MysqliDriver.php | UTF-8 | 4,733 | 2.859375 | 3 | [] | no_license | <?php
/**
* @author thomas<thomas@ikinvin.com>
* @since 2014-03-24
* Class Libs_Mysql_MysqlDriver
*/
class Libs_Mysql_MysqliDriver {
public $version;
public $driver_type = 'mysqli';
public $table_prefix;//表前缀,如pre_
public $cur_link;
public $config;
public $query_num;
//设置配置信息
publ... | true |
452aa81d52b75e7ad2be965acb3f663b704791a3 | PHP | elisons/php-mysqli-login-and-registration | /register.php | UTF-8 | 8,483 | 2.65625 | 3 | [] | no_license | <?php
/* Registration process, inserts user info into the database
and sends account confirmation email message
*/
//connection to the database
require 'db.php';
//session session_start
session_start();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
# code...
$first_name = $mysqli->escape_string(test_input($_PO... | true |
585ac4578d9823bf574b951fc3fd7be413ca80c6 | PHP | lanmys/TestPHP | /sx4-1.php | UTF-8 | 1,167 | 2.703125 | 3 | [] | no_license | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<form name="form1" id="form1" action="" ... | true |
6f4a5257246b8acdda726be768720b08d7e8df53 | PHP | zavalacl/iwlocal3 | /inc/requests/getWorkDescriptionItems.php | UTF-8 | 2,682 | 2.578125 | 3 | [] | no_license | <?php
require('config.php');
require("authenticate.php");
require("functions/stewards_reports.php");
if(! empty($_POST['cid'])){
$category_id = (int) $_POST['cid'];
$subcategory_id = (int) $_POST['sid'];
$counter = (int) $_POST['counter'];
$selected_item = isset($_POST['selected_item'... | true |
ee44bcc9309755facc190df7cd5cecba19fab15e | PHP | xi-project/xi-storage | /library/Xi/Storage/Zend/SessionStorage.php | UTF-8 | 2,214 | 2.96875 | 3 | [] | no_license | <?php
namespace Xi\Storage\Zend;
use Xi\Storage\Storage;
/**
* Stores data into a Zend_Session_Namespace instance
*
* @category Xi
* @package Storage
* @subpackage Storage_Zend
* @author Eevert Saukkokoski <eevert.saukkokoski@brainalliance.com>
*/
class SessionStorage implements Storag... | true |
af4119a8f4d5a92a9b64a56941d7fbd996699d3c | PHP | OmarAdelAmr/Cloud-Security-Project | /Source Code/Neo4jDB/transferData.php | UTF-8 | 1,994 | 2.765625 | 3 | [] | no_license | <?php
// Connect to Neo4j Database
require_once '/usr/local/bin/vendor/autoload.php';
use GraphAware\Neo4j\Client\ClientBuilder;
$client = ClientBuilder::create()
->addConnection('bolt', 'bolt://neo4j:OmarAdel12345@localhost:7687')
->build();
// Connect to MySQL Database
$servername = "localhost";
$username ... | true |
564e6f5ea6ba4269f1b3064497067cd0ea5ae94a | PHP | allixsenos/comics | /include/classes/Strip_UnitedMedia.php | UTF-8 | 552 | 2.546875 | 3 | [] | no_license | <?php
abstract class Strip_UnitedMedia extends Strip_Search {
public $um = '';
protected $search_url = 'http://www.unitedmedia.com/comics/{um}/archive/{um}-%Y%m%d.html';
protected $search_pattern = '@<img.+src="(/comics/{um}/archive/images/{um}.+)"@Uis';
public $baseurl = 'http://www.unitedmedia.com';
... | true |
a5b15db1cba276091a1acc9d4e26d8533c09dfa0 | PHP | trekksoft/php-sdk | /src/Smartwaiver/Smartwaiver.php | UTF-8 | 14,439 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | <?php
/**
* Copyright 2017 Smartwaiver
*
* 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 applicable law or agr... | true |
d43d84a667e355396a95457dc1dba32d90303b55 | PHP | RizkiHerdaID/infogue | /app/Http/Controllers/Admin/AuthController.php | UTF-8 | 3,334 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace Infogue\Http\Controllers\Admin;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Infogue\Http\Controllers\Controller;
use Infogue\Http\Requests;
use Validator;
class AuthController ... | true |
45c42993117aa027cb2853fafea661ab2a211a6b | PHP | MarjoMaris/PPE_Fredi | /PPE3-Fredi-MM_MPB_LP_CG--master/FREDI/classes/NoteDAO.php | UTF-8 | 1,994 | 3.09375 | 3 | [] | no_license | <?php
class NoteDAO extends DAO {
/**
* Constructeur
*/
function __construct() {
parent::__construct();
}
/**
* Lecture d'une Note par son ID
* @param int ID de le Note
* @return \Note
*/
public function find($id)
{
$sql = "SELECT... | true |
ef9baa8319d72939a5b676cb39f6e1db2c880cfc | PHP | imyhacker/ENCHIPER | /chiper/chiper | UTF-8 | 2,008 | 2.609375 | 3 | [] | no_license | #!/usr/bin/env php
<?php
/*
============ {IndoSec Framework} =============
Coded By Arikun - IndoSec
Tools : ENCHIPER (ENCRYPT AND USE A CHIPER)
Copyrigt (C) 2020 - Nii-san Hax0r
============ {IndoSec Framework} =============
*/
function proses($data1, $data2)
{
$mode = $data1;
$text = fopen($data2, 'r'... | true |
1d9f452cc17661fbe8160ae41f8ac880371b93c0 | PHP | zksmnp/minjust | /src/Entity/LawFormation.php | UTF-8 | 2,232 | 2.75 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace SomeWork\Minjust\Entity;
/**
* @see \SomeWork\Minjust\Tests\Unit\Entity\LawFormationTest
*/
class LawFormation
{
/**
* @var string
*/
protected $organizationalForm = '';
/**
* @var string
*/
protected $name = '';
/**
* @var str... | true |
bce6b6dded4f4c1a84b223280e68127a045c015b | PHP | PaulLNG/TpObjet | /src/Application/Router/ParseUriStaticNameHelper.php | UTF-8 | 2,860 | 2.625 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace Application\Router;
use Application\Controller\IndexController;
use Application\Controller\LecturerController;
use Application\Controller\CommunityController;
use Application\Controller\ShowCommunityController;
use Application\Controller\MeetingController;
use Application\C... | true |
cb7f6bae53d1200475061e45efd35234e03be71e | PHP | sagnikmitra/codetigers | /forum.codetigers.org/library/Vanilla/EmbeddedContent/Embeds/QuoteEmbedDisplayOptions.php | UTF-8 | 4,080 | 2.953125 | 3 | [
"LicenseRef-scancode-free-unknown",
"GPL-1.0-or-later",
"GPL-2.0-or-later",
"GPL-2.0-only",
"MIT"
] | permissive | <?php
/**
* @author Adam Charron <adam.c@vanillaforums.com>
* @copyright 2009-2019 Vanilla Forums Inc.
* @license GPL-2.0-only
*/
namespace Vanilla\EmbeddedContent\Embeds;
/**
* Preferences on how to display a quote.
*/
class QuoteEmbedDisplayOptions implements \JsonSerializable {
/** @var bool */
priv... | true |
9136cc2b61cd664e0d54ce70141cdb3aaa4883dd | PHP | rafuch0/php-ipconverter | /index.php | UTF-8 | 1,124 | 3.28125 | 3 | [] | no_license | <?php
function getFormHTML()
{
$output = '';
$output .= <<< 'EOD'
<html>
<head>
</head>
<form action="" method="GET">
<input type="text" name="ip"></input>
<input type="submit" name="submit">
</form>
</html>
EOD;
return $output;
}
function getOctalIP($input)
{
$parts = explode('.', $input);
$output = '';
for... | true |
fb902cc68a317a5fddfd42152efa0673bfef4757 | PHP | Devloger/thingspeakWeather | /Weather.php | UTF-8 | 944 | 3.03125 | 3 | [] | no_license | <?php
use GuzzleHttp\Client;
class Weather
{
public $temperatura;
public $cisnienie;
public $wilgotnosc;
public $predkosc;
public $kat;
public $zachmurzenie;
public function __construct()
{
$httpClient = new Client();
$response = $httpClient->get('api... | true |
861ef55774ad1b87f614b306c39d87d7cd735368 | PHP | mako-framework/pusher | /src/PusherMiddleware.php | UTF-8 | 643 | 2.515625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
/**
* @copyright Frederic G. Østby
* @license http://www.makoframework.com/license
*/
namespace mako\pusher;
use Closure;
use mako\http\Request;
use mako\http\Response;
use mako\http\routing\middleware\MiddlewareInterface;
/**
* Pusher middleware.
*
* @author Frederic G. Østby
*/
class PusherMiddlewa... | true |
ffc817bf686da76071733a83def8871d40c7a026 | PHP | gries/php-couchbase | /php/src/CouchbaseN1qlQuery.class.php | UTF-8 | 3,169 | 3.1875 | 3 | [
"Apache-2.0"
] | permissive | <?php
/**
* File for the CouchbaseN1qlQuery class.
*/
/**
* Represents a N1QL query to be executed against a Couchbase bucket.
*
* @package Couchbase
*/
class CouchbaseN1qlQuery {
/**
* @var string
* @internal
*/
public $options = array();
const NOT_BOUNDED = 1;
const REQUEST_PLUS... | true |
3cdfd6ea37b5a87e70adcde9814a83cc3228965f | PHP | bolaft/viaterra | /admin/includes/functions/advshipper.php | UTF-8 | 8,779 | 2.625 | 3 | [] | no_license | <?php
/**
* advshipper Configuration Generation Functions
*
* This file contains functions necessary to generate the configuration options for the Advanced
* Shipper shipping module.
*
* @author Conor Kerr <zen-cart.advshipper@dev.ceon.net>
* @copyright Copyright 2007-2009 Ceon
* @link htt... | true |
10ff363e2fd4c75cbaed6331eba1d09f2478b2c2 | PHP | brewlin/framework | /src/core/Processor/ProcessorInterface.php | UTF-8 | 231 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace Core\Processor;
/**
* Processor interface
* @since 2.0
*/
interface ProcessorInterface
{
/**
* Handle processor
*
* Return `true` is to continue
*/
public function handle(): bool;
}
| true |
67066bf0294cd05c4e5fed478e51609f3e69c2a8 | PHP | Owl-planet/MyPHPFiles | /Döngüler/for/forDongusu_6.php | UTF-8 | 142 | 2.984375 | 3 | [] | no_license | <?php
// Tersten yazdırmak
$matrix = ["Neo", 'Morpheus', 'Trinity', 'Cypher', 'Tank'];
for ($i = 4; $i > -1; $i--)
echo $matrix[$i].'<br>';
?> | true |
10fa01058264dbabadb6dca472e49dacd652b715 | PHP | PHP-CS-Fixer/PHP-CS-Fixer | /src/RuleSet/RuleSets.php | UTF-8 | 1,666 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
/*
* This file is part of PHP CS Fixer.
*
* (c) Fabien Potencier <fabien@symfony.com>
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace PhpCsFixer\Rule... | true |
764cdb7e777029479aa6d7fbf701f1562141799f | PHP | Joephper/singlechip | /application/common.php | UTF-8 | 2,530 | 2.75 | 3 | [] | no_license | <?php
use think\Db;
use PHPMailer\PHPMailer;
// 应用公共文件
//过滤公告题目摘要
function getNoticeContent($content)
{
return strip_tags(html_entity_decode($content));
}
//过滤新闻题目摘要
function getNewsContent($content)
{
return mb_substr(strip_tags(html_entity_decode($content)),0,30).'...';
}
//获取章节名称
if (!function_exists('getCa... | true |
9c99970617e170b556a151b0e80621dcc5855060 | PHP | AlxDeex/mymoney | /app/Http/Requests/TransactionAdd.php | UTF-8 | 1,038 | 2.59375 | 3 | [] | no_license | <?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class TransactionAdd extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get th... | true |
4c1d636b835b17263d4bf39fda8f806e92733870 | PHP | labs-holic/chain-of-responsability | /src/Alarm.php | UTF-8 | 260 | 2.609375 | 3 | [] | no_license | <?php namespace Acme;
class Alarm extends HomeChecker
{
public function check(HomeStatus $home)
{
if (!$home->alarmOn) {
throw new \Exception('The alarm are not set!! Abort Abort!!');
}
$this->next($home);
}
}
| true |
b875644cebb7dc9f7555e1cbbc9781f70ade8234 | PHP | skaeneman/CS602-Server-Side-Web-Development | /CS602_HW4_Kaeneman/CS602_Module4Samples/basics/ex07_arrays.php | UTF-8 | 654 | 3.359375 | 3 | [] | no_license | <!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>Indexed Arrays</title>
</head>
<body>
<p>
<?php
// declare and initialize the array in one statement
$online_web_dev_courses = array("CS 601", "CS 602", "CS 701");
/* declare array with first value and
keep adding subsequent values
*/
... | true |
c99e43202fe4ef651e9c229b4348f8c80fec850a | PHP | yakupguvenc/vehicle-case | /app/Http/Controllers/Api/VehicleController.php | UTF-8 | 1,039 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use App\Repositories\VehicleRepositoryInterface;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
class VehicleController extends Controller
{
private Vehic... | true |
2435f8561b06b00a734afc57b4758c263fee4810 | PHP | ajeven/PHP-exercises | /array_sort.php | UTF-8 | 348 | 3.046875 | 3 | [] | no_license | <?php
$letters = array('e', 'a', 'g', 'x', 'i', 'd', 'f', 'b', 'h', 'r', 'p', '42', '4', '2', 'yea');
for ($i = 0; $i < count($letters); $i++) {
for ($x = 0; $x < count($letters)-1; $x++) {
if ($letters[$x] > $letters[$x+1]) {
$sorted = $letters[$x+1];
$letters[$x+1] = $letters[$x];
$letters[$x] = $sorted;... | true |
2193cb9f682a5606ab34f5c5dac13bf614bf91c3 | PHP | sofi-lo/sportIn | /src/Entity/Category.php | UTF-8 | 2,454 | 2.578125 | 3 | [] | no_license | <?php
namespace App\Entity;
use App\Repository\CategoryRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CategoryRepository::class)
*/
class Category
{
/**
* @ORM\Id
* @ORM\Genera... | true |
f39e9389e0fdc7c0106e49b63c97e3d997ec1ab1 | PHP | squirrelphp/strings | /tests/StringTesterTest.php | UTF-8 | 1,296 | 2.921875 | 3 | [
"MIT"
] | permissive | <?php
namespace Squirrel\Strings\Tests;
use Squirrel\Strings\Tester\ValidDateTimeTester;
use Squirrel\Strings\Tester\ValidUTF8Tester;
class StringTesterTest extends \PHPUnit\Framework\TestCase
{
public function testValidDateTime(): void
{
$format = 'Y-m-d';
$tester = new ValidDateTimeTester(... | true |
158c5764076d4b23f39872b373bb15b4fc20d02f | PHP | clas-web/news-hub-sections | /classes/model.php | UTF-8 | 5,303 | 2.8125 | 3 | [] | no_license | <?php
require_once( NHS_PLUGIN_PATH.'/classes/section.php' );
/**
* The main model for the UNC Charlotte News Hub theme.
*
* @package unc-charlotte-news-hub-theme
* @subpackage classes/model
* @author Crystal Barton <atrus1701@gmail.com>
*/
if( !class_exists('NHS_Model') ):
class NHS_Model
{
/**
* Th... | true |
84ca59711c94188e5f4883cc2bc60b5aebdee034 | PHP | Roma-Kolesnik/OOP | /Homework1.php | UTF-8 | 5,039 | 3.203125 | 3 | [] | no_license | <?php
class Animal
{
private $type, $class, $family, $kind;
public function getType()
{
return $this->type;
}
public function setType($type)
{
$available_types = [
'Spongia', 'Plathelmintes', 'Mollusca', 'Arthropoda', 'Chordata'
];
if (is_string($ty... | true |
630c3d711d62a598a77ba70e52ebc7ec0a32e78c | PHP | Teng-Teng/Shop-RestApi | /Shop-RestApi/manage.php | UTF-8 | 700 | 2.59375 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: teng
* Date: 10-Apr-18
* Time: 04:45 PM
*/
class manage {
/**
*
*/
public function insertItem() {
$name = $_POST['ins_name'];
$price = $_POST['ins_price'];
$imageUrl = $_POST['ins_url'];
$description = $_POS... | true |
76946faa5b8b9c51c7183213c335df25c329f619 | PHP | king6310/test | /php/基础语法/6数组/93.php | UTF-8 | 911 | 3.75 | 4 | [] | no_license | <?php
//each '每一个'
$arr = array('男','女','老','幼');
/*
* 分析:第1个单元 键:0 值:男
*
* each的作用是把指针指向的当前单元的信息组成一个数组
* 数组有4个单元,具体如下:
*
* array(
* 1=>'单元值',
* 'value'=>'单元值',
* 0=>'单元键',
* 'key'=>'单元键'
* )
*
* Array(
1 => 男
'value' => 男
0 => 0
'key' => 0
)
*/
print_r(each($arr));
//each不仅把当前指针指... | true |
f7d06b13ea64735f636833c64b3a869c5e5af023 | PHP | ludidiya/WebdesignAssignment | /Property_result.php | UTF-8 | 4,806 | 2.53125 | 3 | [] | no_license | <?php
session_start();
?>
<?php
include "navigation.html";
require_once 'login.php';
require_once 'redir.php';
?>
<div id="write" class="container">
<h2>Property search result</h2><hr>
<?php
$db_server = mysql_connect($db_hostname,$db_username,$db_password);
if(!$db_server) die("Unable to connect to database: " . my... | true |
ddcc8e1cd6d52d85efdd7ab124ace2fd3165335d | PHP | LotusEliza/PHP_DB_TASK | /task_5/libs/Cookie.php | UTF-8 | 570 | 2.8125 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: lotus
* Date: 3/31/19
* Time: 12:18 PM
*/
class Cookie implements iWorkData
{
public function saveData($key, $val){
setcookie($key, $val, time() + (86400 * 30), "/");
if(!isset($_COOKIE[$key])) {
return ERROR_COOK_SET;
}else{
... | true |
313a33f930a243fcf84d8d8f389dbd00e453e6a2 | PHP | zipofar/7vetrov | /app/model/MTask3.php | UTF-8 | 1,021 | 2.734375 | 3 | [] | no_license | <?php
defined('BASEPATH') or die;
require_once BASEPATH . '/app/model/BaseModel.php';
class MTask3 extends BaseModel
{
public function createTable()
{
$sql = 'CREATE TABLE IF NOT EXISTS `tree` (`id` bigint NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `parent` bigint NOT NULL, PRIMARY KEY (`... | true |
d048768040dd8cd25eab84ca9feba813b4994a20 | PHP | barryjarman/santaslist | /php/submit.php | UTF-8 | 5,010 | 2.984375 | 3 | [] | no_license | <?php
include 'library.php' ;
class RedeemAPI {
private $db;
// Constructor - open DB connection
function __construct() {
$this->db = new mysqli('127.2.185.130', 'adminF2Jbm2B', 'nCi6Du5zhr4B' , 'santaslist');
$this->db->autocommit(FALSE);
}
// Destructor - close DB connection
fun... | true |