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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
29ac6fc39c6d1a9fa76f520dc20e6e8c37a65687 | PHP | jegawaran/test-server | /six/getoddnumber.php | UTF-8 | 605 | 3.515625 | 4 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: jegatheeswaran
* Date: 6/21/2018
* Time: 3:44 PM
*/
function getOddnumber(array $srcValues){
$sizeof = sizeof($srcValues);
//echo '<pre>'; print_r($sizeof);
for($i=0;$i<$sizeof;$i++){
//print_r([$srcValues][$i]);
$count= 0;
for($j=0;$j<$... | true |
dae5922030910276eae672b070804848246cb32f | PHP | Martsynenko/openforum | /controllers/messages.controller.php | UTF-8 | 14,470 | 2.671875 | 3 | [] | no_license | <?php
class MessagesController extends Controller {
public function __construct(array $data = [])
{
parent::__construct($data);
$this->model = new modelMessages();
}
/*
* Сообщения (вопросы) - это разосланные вопросы определнным специалистам(зарегистрированным пользователям)
... | true |
902bebff8d4d43198820124a4b42a2dbe408953c | PHP | IWS-Spring-2021/Worldnews | /webservices/models/Category.php | UTF-8 | 3,379 | 3.21875 | 3 | [] | no_license | <?php
class Category
{
// DB stuff
private $conn;
private $table = 'category';
// Post Properties
public $id;
public $category;
// Constructor with DB
public function __construct($db)
{
$this->conn = $db;
}
// Get Posts
public function read_all()
{
// Create query
$query = "SELEC... | true |
45a1d7238a84168f4e9d2b2365d9b6bd5c66ea43 | PHP | jtad009/udo_boiler | /src/Form/SmsForm.php | UTF-8 | 3,599 | 2.59375 | 3 | [] | no_license | <?php
namespace App\Form;
use Cake\Form\Form;
use Cake\Form\Schema;
use Cake\Validation\Validator;
use Cake\Network\Http\Client;
/**
* Sms Form.
*/
class SmsForm extends Form
{
/**
* Builds the schema for the modelless form
*
* @param \Cake\Form\Schema $schema From schema
* @return \Cake\Form... | true |
22da958a1979920baccd6c1ec66d77e87a9fbda5 | PHP | kingkernel/socialdevelopers | /app/Models/User.php | UTF-8 | 1,328 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use App\Helpers\thisSystem;
class User extends Authenticatable
{
use HasFactory, Notif... | true |
291aa30411b7fb0eb9d999726d82bad6af323198 | PHP | arizalsultan25/JWP_borang | /database/factories/RoomFactory.php | UTF-8 | 1,425 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
namespace Database\Factories;
use App\Models\Room;
use Illuminate\Database\Eloquent\Factories\Factory;
class RoomFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Room::class;
/**
* Define the model's defau... | true |
31ed6368b131655845caea9d800e7081a4bd488a | PHP | craidler/hb9hcr-library | /Entity/Duration.php | UTF-8 | 895 | 3.265625 | 3 | [] | no_license | <?php
namespace HB9HCR\Entity;
use HB9HCR\Base\Item;
/**
* Class Duration
*
* @property int $h
* @property int $m
* @property int $s
* @property string $hm
* @property int $value
*/
class Duration extends Item
{
/**
* @return string
*/
public function hm(): string
{
return sprint... | true |
509ac8813bdb3476747eae83c30bc26cbdf5f671 | PHP | concretecms/concretecms | /concrete/src/Permission/Response/Response.php | UTF-8 | 3,841 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
namespace Concrete\Core\Permission\Response;
use Exception;
use Concrete\Core\User\User;
use Concrete\Core\Support\Facade\Application;
use Concrete\Core\Permission\Category as PermissionKeyCategory;
use Core;
class Response
{
/** @var \Concrete\Core\Permission\ObjectInterface */
protected $object;
/... | true |
e09da08fa1c1f3861bdbcc50106fffc4f41459fb | PHP | librenms-plugins/Weathermap | /lib/editor.inc.php | UTF-8 | 23,159 | 2.796875 | 3 | [
"GPL-2.0-only",
"MIT",
"CC-BY-2.5"
] | permissive | <?php
/** editor.inc.php
*
* All the functions used by the editor.
*/
/** @function fix_gpc_string
*
* Take a string (that we got from $_REQUEST) and make it back to how the
* user TYPED it, regardless of whether magic_quotes_gpc is turned on or off.
*
* @param string $input String to fix
*
* @ret... | true |
361752242a915d571bd084d8b02cd2134eeed76f | PHP | Emjy1990/Portfolio | /Mealoclock/app/Controllers/CommunityController.php | UTF-8 | 887 | 2.59375 | 3 | [] | no_license | <?php
// MealOclock => app/
// Controllers => Controllers/
// au final => app/Controllers/
namespace MealOclock\Controllers;
// Import des classes externes
use MealOclock\Models\CommunityModel;
class CommunityController extends CoreController {
public function community($urlParams) {
// Je récupère l'id ... | true |
5bd736f96d4ac3bb6ddc6bb8acbd951a411a2def | PHP | gitter-badger/dephpend | /src/Formatters/PlantUmlFormatter.php | UTF-8 | 772 | 2.75 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Mihaeu\PhpDependencies\Formatters;
use Mihaeu\PhpDependencies\Dependencies\DependencyPair;
use Mihaeu\PhpDependencies\Dependencies\DependencyPairSet;
class PlantUmlFormatter implements Formatter
{
/**
* {@inheritdoc}
*/
public function format(DependencyPair... | true |
32d1dd6e4c45c0e82d012f5a2c727d1011d8efb1 | PHP | joebubna/Cora | /vendor/cora/cora-framework/system/classes/Session.php | UTF-8 | 744 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
namespace Cora;
class Session
{
public function __construct($data = false)
{
$this->start();
}
public function __get($name)
{
if (isset($_SESSION[$name])) {
return $_SESSION[$name];
}
return false;
}
public function __set($name, $v... | true |
aca0bd239674ae683bf042d705d835f7140768ce | PHP | jonathanpglick/jquery-mobile-seed | /application/lib/app/BaseAPI.php | UTF-8 | 1,535 | 2.90625 | 3 | [] | no_license | <?php
/**
* @file
* Class to manage requesting data from the API.
*/
require_once ROOT_PATH . '/application/lib/app/render.php';
class BaseAPI {
// 12 hours.
const MEMCACHED_EXPIRATION = 43200;
protected static $memcachedPrefix = 'mobile_site_';
protected static $memcached = FALSE;
/**
* Set the mem... | true |
937036e32a152d113693de07cc1a44f5f4daf2cb | PHP | benboute/hector | /Hector/Core/Db/QueryBuilder/QueryPart/Where.php | UTF-8 | 548 | 2.84375 | 3 | [] | no_license | <?php
namespace Hector\Core\Db\QueryBuilder\QueryPart;
class Where extends QueryPart
{
private $conditions;
public function init( $conditions )
{
$this->conditions = $conditions;
$this->query->bindValues( $this->conditions );
}
public function limit( $limit )
{
return $this->query->add( 'Limit', [ $limi... | true |
058b720edceee30584646a1ceb06daf7505d91ee | PHP | bg1bgst333/Sample | /php/class/const/src/class/const.php | UTF-8 | 212 | 3.15625 | 3 | [
"MIT"
] | permissive | <html>
<head>
<title>class#const</title>
</head>
<body>
<?php
class TestClass{
const NUM = 10;
}
//TestClass::NUM = 20;
echo TestClass::NUM;
?>
</body>
</html>
| true |
4ab7201ec6c8dc3eb0b9fe1b738c8d7753d48e87 | PHP | HelaGone/deriva_v2_1.0 | /output.php | UTF-8 | 6,721 | 2.515625 | 3 | [] | no_license | <?php
include('header.php');
include('connect_to_db.php');
include('parts/part-outputform.php');
$the_function = '';
$the_search = '';
$the_search_key = '';
$file_type_query = '';
if( $_SERVER['REQUEST_METHOD'] == 'POST' ):
$file_ID = ($_POST['the_file_id']) ? $_POST['the_file_id'] : '';
$file_name = ... | true |
d08c8d10e3011095e9c3238d80e3c9169c89294d | PHP | wudnf/my | /mogujie/action/stu.php | UTF-8 | 651 | 2.78125 | 3 | [] | no_license | <?php
//对学生信息的增删改查
//1 引入配置文件 引入model类
include("dbconfig.php");
include("Model.php");
//2 实例化model产生一个mod对象
$mod = new Model("stu");
//根据前端传递的值 实现对stu表的增删改查
switch($_GET['a']){
case "insert":
$res['info'] = $mod->insert();
break;
case "delete":
$res['info'] = $mod->del($_GET['id']);
break;
c... | true |
ea805fe9bddf110a86524fb04b0ed64328f82f98 | PHP | omaben/paxful-back | /vendor/flying-panda/php-framework/libs/MySql/Search.php | UTF-8 | 2,286 | 2.6875 | 3 | [] | no_license | <?php
namespace Libs\MySql;
use Libs\DataSource\Interfaces\Field;
use Libs\DataSource\Interfaces\SearchInfo;
use Manage\CoreManage;
class Search implements \Libs\DataSource\Interfaces\Search
{
private array $fieldList = [];
private array $table;
private SearchInfo $searchInfo;
function addFieldLis... | true |
db78a4ca51aa857b2230e7392bf4b0122ba6511d | PHP | matteodedonno02/covid19 | /phpClass/Utente.php | UTF-8 | 1,255 | 3.578125 | 4 | [] | no_license | <?php
class Utente
{
private $CF;
private $nome;
private $cognome;
private $username;
private $password;
private $amministratore;
public function __construct($CF, $nome, $cognome, $username, $password, $amministratore)
{
$this->CF = $CF;
$this->nome = $nom... | true |
b8142210f5618b43ac04a8ddedefb583b4a708c9 | PHP | barshamalbul/attendance-mgnt-system | /controller/teacher/view_attendance_controller.php | UTF-8 | 2,085 | 2.546875 | 3 | [] | no_license | <?php
if(isset($_POST['send']))
{
$errcount=0;
$err = array();
if((isset($_POST['class'])) && (!empty($_POST['class'])))
{
$class=$_POST['class'];
}
else
{
$errclass="enter the class";
$err['class']="class is empty";
$errcount++;
}
if((isset($_POST['s... | true |
38f1427aec7dcf3ba20166baf3323b5b87f3e325 | PHP | nfonseca1/Slotify | /includes/classes/Account.php | UTF-8 | 1,023 | 3.453125 | 3 | [] | no_license | <?php
class Account
{
private $errorLogs;
public function __construct()
{
$errorLogs = array();
}
public function validate($un, $fn, $ln, $email, $pass, $pass2)
{
validateUsername($un);
validateName($fn);
validateName($ln);
validateEmail($email);
validatePassword($pass, $pass2);
... | true |
7d63be3d49d578e7c06f76a3722eb01624cb87a0 | PHP | Stranger7/e-test | /core/db_drivers/sql_builders/SqlBuilder.php | UTF-8 | 16,616 | 2.921875 | 3 | [
"MIT"
] | permissive | <?php
/**
* This file is part of the Crystal framework.
*
* (c) Sergey Novikov (novikov.stranger@gmail.com)
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Date: 20.12.2014
* Time: 23:31
*/
namespace core\db_drivers\sql_builde... | true |
b7f8e4e32912eb08bb6ee90abe044e8b88a8a14a | PHP | DarioMora/DAI_codeIgniter | /application/models/vehiculo.php | UTF-8 | 1,060 | 2.890625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Vehiculo
{
private $vin;
private $patente;
private $marca;
private $moldeo;
private $color;
private $anio;
function __construct() {
}
function getVin() {
return $this->vin;
}... | true |
3be8697835283fdf0fc7ac09dccc410835e52c77 | PHP | BrowserGameScriptz/xnova-game | /app/modules/Core/Models/Session.php | UTF-8 | 1,580 | 2.609375 | 3 | [] | no_license | <?php
namespace Friday\Core\Models;
use Phalcon\Di;
use Phalcon\Mvc\Model;
use Phalcon\Security\Random;
/** @noinspection PhpHierarchyChecksInspection */
/**
* @method static Session[]|Model\ResultsetInterface find(mixed $parameters = null)
* @method static Session findFirst(mixed $parameters = null)
*/
class Se... | true |
ec4f87effe4f24e18f3b0eb038c30be99740c95e | PHP | generalsoftby/code-examples | /Oleg/PHP-Services/Services/Calculator/FrontConverter/ErrorsConverter.php | UTF-8 | 1,454 | 3.015625 | 3 | [] | no_license | <?php
namespace App\Services\Calculators\FrontConverter;
use App\Services\Calculators\Errors;
use App\Services\Calculators\FrontConverter\Contracts\ErrorsConverter as ErrorsConverterInterface;
use App\Services\Calculators\FrontConverter\Traits\ThrowsNoneErrorsException;
/**
* Converts the given errors to some forma... | true |
16f948a85c2aff4303db0da02f412830c8042c96 | PHP | freshy969/Saito | /app/Controller/StatusController.php | UTF-8 | 1,230 | 2.53125 | 3 | [] | no_license | <?php
App::uses('AppController', 'Controller');
class StatusController extends AppController {
public $uses = [
'Shout'
];
public $autoRender = false;
/**
* Current app status ping
*
* @return string
* @throws BadRequestException
*/
public function status() {
$data = [
'lastSho... | true |
9e0a87171322957b7d796b089d9d641da2539838 | PHP | Xeragus/Winery | /app/Core/ResultLists/Pagination/PaginatableResultsInterface.php | UTF-8 | 465 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Core\ResultLists\Pagination;
interface PaginatableResultsInterface
{
public function setOffset(int $offset);
/**
* @return int|null
*/
public function getOffset();
public function setItemsPerPage(int $items);
public function resetItemsPerPage();
/**
* @re... | true |
17a2050d1999d88cf597336385fdcda7f5e98afa | PHP | shivank1404/getmehome1 | /signup.php | UTF-8 | 1,989 | 2.8125 | 3 | [] | no_license | <html>
<head><title> Sign up</title></head>
<?php
// define variables and set to empty values
$user= "";
$password= "";
$email= "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$user = test_input($_POST["user"]);
$password = test_input($_POST["password"]);
$email = test_input($_POST["email"]);
}
function tes... | true |
ef61e36ee55fd8af05cbaff8d091a8224fd43eea | PHP | phly/PhlyPaste | /src/PhlyPaste/View/Highlight.php | UTF-8 | 2,887 | 2.859375 | 3 | [] | no_license | <?php
namespace PhlyPaste\View;
use DOMDocument;
use DOMXPath;
use GeSHi;
use HTMLPurifier;
use HTMLPurifier_Config;
use Zend\View\Helper\AbstractHelper;
class Highlight extends AbstractHelper
{
public function __invoke($content, $language)
{
if ($language == 'markdown') {
return $this->r... | true |
ac77e9ebc88eb7fbb1cda85efbf1f50705dfcd31 | PHP | MichaelJouve/rezalps | /app/Http/Controllers/Api/PostController.php | UTF-8 | 1,636 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Api;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Post;
use Illuminate\Support\Facades\Auth;
class PostController extends Controller
{
public function index()
{
return Post::all();
}
public function show(Post $post)
{
... | true |
b96bf678941cbbae658550c80a92a94a971a8f31 | PHP | joaopfzousa/UFP-library | /app/Http/Controllers/UsersController.php | UTF-8 | 2,712 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use App\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use App\Helpers\APIHelpers;
class UsersController extends Controller
{
private $user;
private $request;
private $apiHelpers;
/**
* Create a new controller instance.
*
... | true |
fd70fe57c5f4675b9d8b833b8c15763bfc1b4d8c | PHP | hindolam/camaga.org | /artists/Artist.php | UTF-8 | 701 | 3.25 | 3 | [] | no_license | <?php
class Artist
{
var $artist;
function __construct($concert, $index)
{
$artists = $concert->getArtists();
$this->artist = $artists[$index];
}
function getName()
{
return $this->artist["name"];
}
function getInstrument()
{
return $this->... | true |
3a1ff681b6286b9f3bd54a987b0690b662f0d8bc | PHP | Lesnier/HC_Sistem | /Dominio/Turno.php | UTF-8 | 965 | 2.578125 | 3 | [] | no_license | <?php
class Turno
{
public function Consultar_Turno($sql)
{
$base=new Conexion;
$con=$base->conectardb();
$res=$con->Execute($sql);
$datos=array();
while(!$res->EOF)
{
$datos[]=array("id_tu"=>$res->fields[0],"id_usu"=>$res->fields[1],"id_pac"=>$res->fields[2],"id_hor"=>$res->fields[3],"fechaR_tu"=>$... | true |
cb4671eaf7742753476ff098be552edaf2111d14 | PHP | langr-org/langr | /hphp/plugin/cphp/include/function/xml.fun.php | GB18030 | 1,771 | 3.328125 | 3 | [
"MIT"
] | permissive | <?php
/**
* xml DQɞ array
*
* @param string xmlı
* @return array DQĔM
*/
function xml2array ($xml)
{
$xmlary = array ();
$ReElements = '/<(\w+)\s*([^\/>]*)\s*(?:\/>|>(.*?)<(\/\s*\1\s*)>)/s';
$ReAttributes = '/(\w+)=(?:"|\')([^"\']*)(:?"|\')/';
preg_match_all ($ReElements, $xml, $element... | true |
c8eb3eefd0d917add2533898301f8c1b26970a57 | PHP | alizafar29/yii2 | /advanced/frontend/models/RegisteredSearch.php | UTF-8 | 1,943 | 2.546875 | 3 | [] | no_license | <?php
namespace frontend\models;
use Yii;
use common\models\User;
use yii\web\UploadedFile;
use frontend\models\Registered;
use yii\data\ActiveDataProvider;
class RegisteredSearch extends Registered
{
public $name;
public $Mobile_Number;
public $Email;
... | true |
16ce2d4f3a56ab60c54c4bfd73c621bd8445aff0 | PHP | chorry/libphonenumber | /src/tools/CarrierWriter.php | UTF-8 | 893 | 3.046875 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace chr\phoneNumber\tools;
class CarrierWriter
{
private $headerWritten = false;
public function __construct($resource)
{
$this->resource = $resource;
}
public function write(array $data)
{
if (!$this->headerWritten) {
$this->h... | true |
9ce22a9c404ead65b990736127615ad44c7a1fd5 | PHP | bjblayney/inventory-tracker | /includes/checkInventory.php | UTF-8 | 2,158 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
include 'db.php';
$jsonResponse = ['status' => false];
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die($jsonResponse['msg'] = 'Connection Error');
}
$sql = [];
$a_bind_params = [];
$a_param_type = [];
// set parameter... | true |
1a54d17337bc1d04bc0518c1cfa668dba1610860 | PHP | magnus-eriksson/guestbook-test | /app/Libraries/Database.php | UTF-8 | 1,864 | 3.328125 | 3 | [] | no_license | <?php namespace App\Libraries;
use PDO;
class Database
{
/**
* @var PDO
*/
protected $pdo;
/**
* @param PDO $pdo
*/
public function __construct(PDO $pdo)
{
// Configure PDO to throw exceptions on error
// and to use ASSOC as default fetch mode
$pdo->se... | true |
cf0e4fc47882cc68a520c30a036456bb43ed4cb9 | PHP | RudyBodo/hotel_reservation-phalcon | /app/forms/testForm.php | UTF-8 | 1,036 | 2.53125 | 3 | [] | no_license | <?php
use Phalcon\Forms\Form;
use Phalcon\Forms\Element\Text;
use Phalcon\Forms\Element\Select;
use Phalcon\Forms\Element\Date;
use Phalcon\Validation\Validator\PresenceOf;
use Phalcon\Validation\Validator\StringLength;
class TestForm extends Form
{
public function initialize()
{
//field checkin
... | true |
2f6476dc8e3ed067bb3c3d925ae0979f35c796db | PHP | travhow99/docutheraphp-laravel | /app/Session.php | UTF-8 | 1,686 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Session extends Model
{
/**
* Mass assignable attributes.
*
* @var array
*/
protected $fillable = ['client_id', 'session_date', 'session_time', 'complete', 'cancelled', 'submitted', 'billed', 'notes'];
/**
* The... | true |
92865e0e61036d859737bdf0f021c17d80168f44 | PHP | Bardo1/daemon-bundle | /src/Uecode/Bundle/DaemonBundle/Command/ExampleCommand.php | UTF-8 | 1,175 | 2.828125 | 3 | [] | no_license | <?php
/**
* @author Aaron Scherer <aequasi@gmail.com>
* @date Oct 12, 2012
*/
namespace Uecode\Bundle\DaemonBundle\Command;
use \Symfony\Component\Console\Input\InputInterface;
use \Symfony\Component\Console\Output\OutputInterface;
use \Symfony\Component\Console\Input\InputArgument;
/**
* Example Command class
... | true |
9dc88ba8b55d8fa2c3633a4171c77290cefe481a | PHP | ComandPromt/JS | /listas_json/cargaProvinciasJSON.php | UTF-8 | 194 | 2.59375 | 3 | [] | no_license | <?php
include('provincias.php');
foreach($provincias as $codigo => $nombre) {
$elementos_json[] = "\"$codigo\": \"$nombre\"";
}
echo "{".implode(",", $elementos_json)."}"
?>
| true |
48148065ba36fc3b9cf237231749674554078801 | PHP | urpi07/ml2 | /application/models/genericQuery.php | UTF-8 | 1,732 | 2.796875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
//Here we encapsulate the repetitive operations
//that are the generic add, edit and delete.
class genericQuery extends CI_Model{
protected $operation = '{operation}';
private $delete = 'delete';
private $edit = 'edit';
//TODO: figure out why it fails when i use $this->operation
//in place of {operation... | true |
637310c627c6081379a87014ab263189713782b4 | PHP | ibidem/mjolnir-base | /Lang.php | UTF-8 | 2,225 | 3.15625 | 3 | [
"BSD-2-Clause"
] | permissive | <?php namespace ibidem\base;
/**
* @package ibidem
* @category Base
* @author Ibidem Team
* @copyright (c) 2008-2012 Ibidem Team
* @license https://github.com/ibidem/ibidem/blob/master/LICENSE.md
*/
class Lang
implements \ibidem\types\Lang
{
/**
* @var string
*/
protected static $lang = 'en-u... | true |
4a78798c1aba7c60d795fea37ef4d76743d72775 | PHP | JobGrouper/jobgrouperdevteam | /app/Http/Controllers/EmailsTemplatesController.php | UTF-8 | 2,043 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use File;
class EmailsTemplatesController extends Controller
{
public function renderEmail($emailTemplateName, $scenario=NULL){
$originTemplatePath = '../resources/views/emails/'.$emailTemplateName.'.blade.php';
... | true |
9cd0b6ac2fb8a00b309eafddb4d40c3c8b8a90f4 | PHP | alex-kalanis/kw_storage | /php-src/Storage/Key/DefaultKey.php | UTF-8 | 328 | 2.625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace kalanis\kw_storage\Storage\Key;
use kalanis\kw_storage\Interfaces\IKey;
/**
* Class DefaultKey
* @package kalanis\kw_storage\Key
* Change nothing - keys are valid as they are
*/
class DefaultKey implements IKey
{
public function fromSharedKey(string $key): string
{
return $key;
... | true |
4c323fe55b7ae5587f4960abc2e28606bb21fd51 | PHP | gregor-tokarev/micro | /app/controllers/Url.php | UTF-8 | 538 | 2.640625 | 3 | [] | no_license | <?php
class Url extends Controller {
public function addUrl() {
$url = trim(filter_var($_POST['url'], FILTER_SANITIZE_STRING));
$shortUrl = trim(filter_var($_POST['shortUrl'], FILTER_SANITIZE_STRING));
$urls = $this->model('urls');
echo $urls->addUrl(['url' => $url, 'shortUrl' => ... | true |
8587ef641e50fc3a388b140c29b7708c2f1f1d0c | PHP | RaviHas/kidscorner | /app/Http/Requests/CreateChildRequest.php | UTF-8 | 1,164 | 2.75 | 3 | [
"MIT"
] | permissive | <?php namespace App\Http\Requests;
use App\Http\Requests\Request;
class CreateChildRequest extends Request {
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*... | true |
67cee71c4cb1051363c35616778a4b549ce14923 | PHP | ARCANEDEV/LogViewer | /src/Utilities/LogStyler.php | UTF-8 | 2,534 | 2.96875 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Arcanedev\LogViewer\Utilities;
use Arcanedev\LogViewer\Contracts\Utilities\LogStyler as LogStylerContract;
use Illuminate\Contracts\Config\Repository as ConfigContract;
use Illuminate\Support\HtmlString;
/**
* Class LogStyler
*
* @author ARCANEDEV <arcanedev.maroc@g... | true |
a41ce5579c7735bbc6015a8a7bcec175339e075d | PHP | Delermando/systemAgendaV3 | /apiAgenda/test/response/ResponseTest.php | UTF-8 | 1,269 | 2.546875 | 3 | [] | no_license | <?php
class ResponseTest extends PHPUnit_Framework_TestCase {
protected $instancia;
protected function setUp() {
$this->instancia = New \Cartao\services\response\Response();
}
/**
* @group testMakeResponse
*/
public function testMakeResponse() {
$this->assertInstanceOf(... | true |
dc87a72ebe17be78e3d9d3af525ff9bd66ac0120 | PHP | luqmankahloon/MoDeCaSo | /server/model/projects/cards.class.php | UTF-8 | 7,050 | 2.8125 | 3 | [] | no_license | <?php
/*
* MoDeCaSo - A Web Application for Modified Delphi Card Sorting Experiments
* Copyright (C) 2014-2015 Peter Folta. All rights reserved.
*
* Project: MoDeCaSo
* Version: 1.0.0
*
* File: /server/model/projects/cards.class.php
* Created: 2014-12-10
* Author: P... | true |
e49627693eacccc338e6b89fd812b9eca4d6fa39 | PHP | PCouaillier/loterie | /src/Service/TransactionService.php | UTF-8 | 899 | 2.609375 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: paulcouaillier
* Date: 30/11/2017
* Time: 12:20
*/
namespace App\Service;
use App\Entity\RoomEntity;
use App\Entity\UserEntity;
use JJWare\Util\Optional;
use Monolog\Logger;
use PDO;
class TransactionService
{
private $db;
private $log;
public function __con... | true |
9b77f15055521d8698cf3bc0c0874cf97bc43e47 | PHP | Marwelln/basset | /src/Basset/SortingIterator.php | UTF-8 | 436 | 2.953125 | 3 | [
"MIT"
] | permissive | <?php
// https://github.com/salathe/spl-examples/wiki/Sorting-Iterators
namespace Basset;
use ArrayIterator;
class SortingIterator extends ArrayIterator {
public function __construct($iterator, $callback) {
if ( ! is_callable($callback)) {
throw new InvalidArgumentException(sprintf('Callback must be callable (... | true |
a1e71a6475bb20dfe1f1ab5becc6b7ea7fca6c37 | PHP | Fincallorca/HitchHikerApi | /src/Wsdl/v3_1_388_1/StructType/SSRRequestData.php | UTF-8 | 5,248 | 2.8125 | 3 | [
"MIT"
] | permissive | <?php
namespace Fincallorca\HitchHikerApi\Wsdl\v3_1_388_1\StructType;
use \WsdlToPhp\PackageBase\AbstractStructBase;
/**
* This class stands for SSRRequestData StructType
* Meta informations extracted from the WSDL
* - nillable: true
* - type: tns:SSRRequestData
* @subpackage Structs
*/
class SSRRequestData ex... | true |
f880f842796227aa80a3946dc9aac760f769fc03 | PHP | Sionist/ALC-MAT | /app/models/Estados.php | UTF-8 | 1,949 | 2.859375 | 3 | [] | no_license | <?php
class Estados extends \Phalcon\Mvc\Model
{
/**
*
* @var integer
*/
protected $id_estado;
/**
*
* @var string
*/
protected $estado;
/**
* Method to set the value of field id_estado
*
* @param integer $id_estado
* @return $this
*/
pu... | true |
57eec363bd05d1d0c2ef4b31b3195773f9c5d2ba | PHP | RafsDuarte/SistemaDeVendas | /app/Http/Controllers/Admin/NumberController.php | UTF-8 | 2,777 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Admin;
use App\Models\Number;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class NumberController extends Controller
{
public function __construct(Number $number)
{
$this->number = $number;
}
/**
* Display a listing of the... | true |
6218338facfb0ed6b7d09684a499f13beb7cc547 | PHP | mdeville/Piscine_PHP_rush00 | /backend/user.php | UTF-8 | 1,728 | 2.6875 | 3 | [] | no_license | <?php
include(__DIR__ . "/general.php");
function add_user($login, $passwd, $group) {
if (!$login || !$passwd || !$group)
return FALSE;
if (($data = file_to_data(__DIR__ . PASSWD)) === FALSE || isset($data[$login]))
return FALSE;
$data[$login] = array();
$data[$login]['passwd'] = hash("whirlpool", $passwd);
... | true |
7904eec9d21de91afc16caacc4a5260941087b9f | PHP | MartimTSilva/Techpower-web | /frontend/tests/functional/SignupCest.php | UTF-8 | 3,489 | 2.578125 | 3 | [] | no_license | <?php
namespace frontend\tests\functional;
use frontend\tests\FunctionalTester;
class SignupCest
{
protected $formId = '#form-signup';
public function _before(FunctionalTester $I)
{
$I->amOnRoute('site/signup');
}
public function signupWithEmptyFields(FunctionalTester $I)
{
... | true |
065afa14be93bf796acc33780ed40d1c37da7778 | PHP | OlivierValette/booklib | /src/Controller/CategoryController.php | UTF-8 | 1,401 | 2.625 | 3 | [] | no_license | <?php
namespace App\Controller;
use App\Entity\Category;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
/**
* Class CategoryController
* @package App\Controller
* @Route("/category")
*/
class CategoryController extends... | true |
6f830cbfd555ed7cbca8c7f8163261bd4e767a86 | PHP | xiebruce/PicUploader | /vendor/cloudinary/cloudinary_php/src/AuthToken.php | UTF-8 | 3,140 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
namespace Cloudinary;
/**
* Class AuthToken
* @package Cloudinary
*/
class AuthToken
{
const UNSAFE = '/([ "#%&\'\/:;<=>?@\[\]^`{\|}~\\\\])/';
/**
* Generate an authorization token.
* Options:
* string key - the secret key required to sign the token
* string ip - the ... | true |
20b015ed30d826fc1d8b750894e6579cadc587ae | PHP | luisrita/matteo | /includes/images.php | UTF-8 | 3,653 | 2.640625 | 3 | [] | no_license | <?php
/**********************************************************
**Remove images size
/**********************************************************/
//stop generating images with the medium and large sizes
//more info: https://developer.wordpress.org/reference/hooks/intermediate_image_sizes_advanced/
function filter_i... | true |
f3858442bc1cb0e5e745038b3120ee4ebaf0774f | PHP | elzup/kitasenju_station_view | /helper/functions.php | UTF-8 | 3,467 | 2.875 | 3 | [] | no_license | <?php
function generate_location_lib($railways) {
$lib = array();
foreach($railways as $rail) {
foreach ($rail->stations as $st) {
$lib[$st->url] = $st->location;
}
}
return $lib;
}
function install_train(&$trains, $lib_location, $lib_timetables, $lib_color) {
foreach (... | true |
52c5ec5949d7af6ff4ed4071898d632c03db1f9d | PHP | czim/laravel-repository | /tests/BaseRepositoryTest.php | UTF-8 | 14,900 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Czim\Repository\Test;
use Czim\Repository\Contracts\BaseRepositoryInterface;
use Czim\Repository\Test\Helpers\TestSimpleModel;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Support\Collection;
class BaseReposi... | true |
a25b962c4ccd66af84d047609b29f74efcaff94e | PHP | michalkleiner/silverstripe-base | /src/Forms/GridField/GridFieldInfoRow.php | UTF-8 | 901 | 2.75 | 3 | [
"MIT"
] | permissive | <?php
namespace LeKoala\Base\Forms\GridField;
use SilverStripe\Forms\GridField\GridField_HTMLProvider;
/**
* A message to display next to a gridfield
*
* @author Koala
*/
class GridFieldInfoRow implements GridField_HTMLProvider
{
/**
* Fragment to write the button to
*/
protected $targetFragmen... | true |
a8e82c583c1299bcf75faaf2884ebabe42da23f1 | PHP | zhangjiquan1/phpsourcecode | /a07061625/swooleyaf/libs_frame/AliOpen/Nas/TieringPolicyDeleteRequest.php | UTF-8 | 593 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace AliOpen\Nas;
use AliOpen\Core\RpcAcsRequest;
/**
* Request of DeleteTieringPolicy
* @method string getName()
*/
class TieringPolicyDeleteRequest extends RpcAcsRequest
{
/**
* Class constructor.
*/
public function __construct()
{
parent::__construct('NAS', '2017-06-26',... | true |
65b1100897d81bebf10337bb0bf676f929c334b9 | PHP | payoub/creditorwatch-interview | /app/CreditorWatch/Transport/Request/HttpRequest.php | UTF-8 | 1,378 | 2.953125 | 3 | [] | no_license | <?php
namespace CreditorWatch\Transport\Request;
class HttpRequest implements RequestInterface {
protected $endpoint;
protected $method = 'GET';
protected $queryParams = array();
protected $postFields = array();
public function setRequestData($requestData = null) {
foreach($requestData as $key => $value){
... | true |
36fbd657986f608a7dd540781a8a361f476a11d1 | PHP | jamestylerwarren/codeup.dev | /codingChallenge.php | UTF-8 | 532 | 3.6875 | 4 | [] | no_license | <?php
//1.)
$string = "welcome to the coding challenge";
function capitalize($string) {
$array = explode(" ", $string);
foreach ($array as $key => $value) {
$array[$key] = ucfirst($value);
}
$newString = implode(" ", $array);
return $newString . PHP_EOL;
}
print_r(capitalize($string));
//2.)
$string = 'abcdefg... | true |
56c99afbb54af1c1b21eefb11b6c23ba65ba97ed | PHP | Gorwast/gaming-webpage | /chat/login.php | UTF-8 | 1,637 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
session_start();
include('header.php');
$loginError = '';
if (!empty($_POST['username']) && !empty($_POST['pwd'])) {
include ('Chat.php');
$chat = new Chat();
$user = $chat->loginUsers($_POST['username'], $_POST['pwd']);
if(!empty($user)) {
$_SESSION['username'] = $user[0]['username'];
$_SESSION['id'] =... | true |
c54797f799a8b1f8a771de05867a8b50e3cfc26c | PHP | bacardi55/i55WebManager | /src/B55/I55WebManager/I55ConfigParser.php | UTF-8 | 957 | 2.71875 | 3 | [] | no_license | <?php
namespace B55\I55WebManager;
//use B55\Entity;
use B55\I55WebManager\Entity\I55Config;
use B55\I55WebManager\Entity\I55Workspace;
class I55ConfigParser {
protected $filename;
protected $workpaces;
public function __construct($filename) {
if (is_file($filename) && is_readable($filename)) {
$this... | true |
18348cea9c3777997a21382fdf8dce05777bb75f | PHP | anhducbkhn/php-design-pattern-example | /Behavioral/Strategy/StrategyUploader.php | UTF-8 | 1,302 | 3.03125 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: AnhDuc
* Date: 6/19/16
* Time: 2:14 PM
*/
interface IUploader
{
public function doUploadImage($originalPath, $newPath);
}
class S3AmazonUpload implements IUploader
{
public function doUploadImage($originalPath, $newPath)
{
// TODO: Implement doUploadI... | true |
ffad8949805cac19224e91e1e7eca8207488db9e | PHP | adejaremola/barterbuy | /app/Blog.php | UTF-8 | 532 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Blog extends Model
{
protected $table = 'blogs';
protected $fillable = ['pic_url', 'title', 'content', 'user_id'];
public static $rules = [
'title' => 'required',
'content' => 'required',
'pic_url' => 'image'
];
//reverse relationsh... | true |
e781af3f5712039f6b71944294838cd64b63a0b8 | PHP | AntonMariadas/umtasa | /controller/membre/modification_cuisiniere_controller.php | UTF-8 | 2,952 | 2.6875 | 3 | [] | no_license | <?php
require_once('model/Database.php');
include('model/Display.php');
include('model/Update.php');
include('controller/Check.php');
$id = $_SESSION['id'];
$db = Database::pdo();
$affichage = new Display($db);
$cuisiniere = $affichage->cuisiniere($id);
if (isset($_POST['modification-cuisiniere'])) {
if (!empty(... | true |
194e84af256bb740ea2c7e6f5ac52a3bc790bd08 | PHP | meandmymonkey/phpbnl13-workshop | /src/Acme/Bundle/DicWorkshopBundle/Adapter/GuzzleAdapter.php | UTF-8 | 660 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace Acme\Bundle\DicWorkshopBundle\Adapter;
use Guzzle\Http\ClientInterface;
class GuzzleAdapter implements AdapterInterface
{
private $httpAdapter;
private $endpointUrl;
public function __construct(ClientInterface $httpAdapter, $endpointUrl)
{
$this->httpAdapter = $httpAdapter;
... | true |
bab3685360c01e90c58c824b86e5e3f8cf26ebb1 | PHP | ArlemGabriel/LaboratorioPHP | /Controlador/DAOusuarios.php | UTF-8 | 4,007 | 2.609375 | 3 | [] | no_license | <?php
include_once 'C:\xampp\htdocs\Modelo\usuario.php';
include_once 'C:\xampp\htdocs\Controlador\conexiondb.php';
require_once 'C:\xampp\htdocs\Controlador\ConexionDB.php';
function validarRegistro($registusuario){
$base=ConexionDB::getInstance();
$sql = 'CALL validatenewuser(:co... | true |
0b752b740db15c9338f0afd46a6e9148a6003e7c | PHP | bearablyk/laravel_api | /app/Models/StoryCatogory.php | UTF-8 | 794 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Reliese\Database\Eloquent\Model;
/**
* Class StoryCatogory
*
* @property int $id
* @property string $name
* @property \Illuminate\Database\Eloquent\Collection $stories
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StoryCatogory whereId... | true |
e298a6c7edd1c46f0869d36bd8d49cffc625e3c9 | PHP | fabiangothman/PHP | /Laravel8_sample1/app/Models/Permission.php | UTF-8 | 571 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Permission extends Model
{
use HasFactory;
/**
* El metodo asume que la foranea se llama "role_id" y que la id del permission_role es "id"
* Relación m:m
* Obtener ... | true |
b6189be360f88085bc95e26698253c72442d390f | PHP | dongitwork/LarevelShop | /database/migrations/2016_04_01_155228_create_wards_table.php | UTF-8 | 792 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateWardsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ward', function (Blueprint $table) {
$table-... | true |
ff590e3b4d3a7f119df6236484bb3c68db6eac6a | PHP | PriymakVl/data.lar | /app/Quote.php | UTF-8 | 1,550 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Quote extends Model
{
use SoftDeletes;
protected $table = 'quotes';
protected $fillable = ['author_id', 'book_id', 'text', 'rating'];
public function book()
{
return $this->belongsTo(... | true |
10a02b2714f44b37f56f06a85a098c154bb3c880 | PHP | drWaka/doctor-attendance-mgmt | /core/php/connection.php | UTF-8 | 1,092 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | <?php
// Application Database Connection
$host = [
"dam" => $_ENV['DB_HOST'],
"bio" => $_ENV['BIO_DB_HOST']
];
$username = [
"dam" => $_ENV['DB_USER'],
"bio" => $_ENV['BIO_DB_USER']
];
$password = [
"dam" => $_ENV['DB_PASS'],
"bio" => $_ENV['BIO_DB_PASS']
];
$database = [
"dam" => $_ENV['DB... | true |
fe8bc35648b1bd8b52b69d0d45083397b31866de | PHP | MonteverdeLtda/php-crud-api | /crm-admin/model/tIdentificationsModel.php | UTF-8 | 600 | 2.546875 | 3 | [] | permissive | <?php
/* *******************************
*
* Developer by FelipheGomez
*
* Git: https://github.com/Feliphegomez/crm-crud-api-php
* *******************************
*/
class tIdentifiactionsModel extends ModeloBase {
private $table;
public function __construct(){
$this->table = TBL_T_IDENTIF... | true |
e3aa9697ea367c83e9097c3033be6a2f309608c7 | PHP | ninomey/Review | /test2.php | UTF-8 | 2,050 | 2.8125 | 3 | [] | no_license | <?php
function bmi($weight,$height) {
if(!$weight && !$height)
return;
$debu= $weight / $height /$height;
if ($debu < 15) {
$result = "がりがり";
}
elseif (15 <= $debu && $debu < 19.5) {
$result = "痩せ";
}
elseif (19.5 <... | true |
fab457244f126ec2f77f2504c9a435dc538c6030 | PHP | jonaselan/univ-control | /app/Http/Controllers/UniversityController.php | UTF-8 | 2,569 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace UnivControl\Http\Controllers;
use UnivControl\University;
use Illuminate\Http\Request;
use UnivControl\Http\Requests\UniversityRequest;
class UniversityController extends Controller
{
// public function __construct()
// {
// $this->middleware('auth');
// }
/**
* Display... | true |
2f0c8127f77de7764a27729a1ed39096dbeae9d2 | PHP | Yanlaz/Vitrans | /Adapter/AbstractAdapter.php | UTF-8 | 1,003 | 2.828125 | 3 | [] | no_license | <?php
namespace Yanlaz\Vitrans\Adapter;
use Yanlaz\Vitrans\Exception\VitransException;
/**
* AbstractAdapter
*/
abstract class AbstractAdapter implements AdapterInterface{
protected $data = array();
protected $defaultLang = 'en_US';
protected $lang = null;
protected $ext = null;
publi... | true |
1f64813c22fdb889bf7ff328f6e6074805a09f2f | PHP | zshall/kimica | /contrib/wiki/theme.php | UTF-8 | 5,277 | 2.90625 | 3 | [] | no_license | <?php
class WikiTheme extends Themelet {
/*
* Show a page
*
* $page = the shimmie page object
* $wiki_page = the wiki page, has ->title and ->body
* $nav_page = a wiki page object with navigation, has ->body
*/
public function display_page(Page $page, WikiPage $wiki_page, $nav_page) { // $nav_page = Wiki... | true |
8debd2d6e78da8d804b55fc3ca1218fc92a8a5cf | PHP | chapellu/Watch_Bot | /PublicSite/core/Url/Request.php | UTF-8 | 524 | 2.796875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: alan
* Date: 21/01/2017
* Time: 22:02
*/
namespace Core\Url;
class Request
{
public $url; //URL appellée par l'utilisateur
public $page = 1; //Par défaut
public $prefix = false;
public $data = false;
function __construct(){
$this->url = $_SE... | true |
7279511a380bd2e12e890869a4c32fc12022fbfc | PHP | zhongweidai/freephp | /src/apps/base/admin/servers/AdminMenuServerBase.php | UTF-8 | 4,626 | 2.625 | 3 | [] | no_license | <?php
defined('IN_FREE') or exit('No permission resources.');
class AdminMenuServerBase extends FreeProServer
{
protected $tree = array();
function __construct()
{
parent::__construct();
}
public function model()
{
$this->model = M('admin_menu','admin');
}
/**
* 获取所有的菜单
**/
public functi... | true |
620e1205fd27635178187eac43ab0db923b17ebf | PHP | justem007/rossina | /app/Repositories/Transformers/BlocoCamisetaTransformer.php | UTF-8 | 771 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace Rossina\Repositories\Transformers;
use League\Fractal\TransformerAbstract;
use Rossina\BlocoCamiseta;
/**
* Class BlocoCamisetaTransformer
* @package namespace Rossina\Repositories/Transformers;
*/
class BlocoCamisetaTransformer extends TransformerAbstract
{
/**
* Transform the \BlocoCam... | true |
71c3092d86e14d9eaccce5454fbd2faf46faf710 | PHP | zapbr/Hackerrank | /utopian/index.php | UTF-8 | 277 | 2.984375 | 3 | [] | no_license | <?php
$_fp = fopen("php://stdin", "r");
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
fscanf($_fp,"%d",$n);
while (($line = fgets($_fp)) !== false) {
echo (preg_match('/^[a-z]{0,3}[0-9]{2,8}[A-Z]{3,}/', $line))? 'VALID' : 'INVALID', PHP_EOL;
}
| true |
2ebfa4ac0ba8c64377c8eaab536643103b2cf0d2 | PHP | janith-rathanyaka/CRUD-PHP-MySQL | /dao/PessoaDao.php | UTF-8 | 2,075 | 3 | 3 | [
"Apache-2.0"
] | permissive | <?php
require_once("../model/Banco.php");
class PessoaDao {
private $mysqli;
public function __construct() {
$this->mysqli = Banco::getInstance()->getConnection();
}
public function salvar($p) {
$stmt = $this->mysqli->prepare("INSERT INTO Pessoa (nome, data_nascimento, cpf, ocup... | true |
c0c8ddb6376f88525bf0b74a85235423ff08cd83 | PHP | osundiranay/Advance-PHP-Complete-Course-With-Codes-By-NBL | /102.RealWorld Use of Session In PHP/login.php | UTF-8 | 899 | 3 | 3 | [] | no_license | <?php
//Start Session
session_start();
if(!isset($_SESSION['uname'])){
if(isset($_REQUEST['username']) || isset($_REQUEST['password'])){
//Set Session Data
$uname=$_REQUEST['username'];
$pass=$_REQUEST['password'];
$_SESSION['uname']=$uname;
$_SESSION['pass']=$pass;
... | true |
97bc53f5d7188243dda45e302c218f24aeae1df6 | PHP | ezra-obiwale/RESTServer | /core/classes/Upload.php | UTF-8 | 809 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
use Exception;
/**
* Description of Upload
*
* @author Ezra Obiwale <contact@ezraobiwale.com>
*/
class Upload extends JsonData {
public static function create($data, $id = null) {
return uploadFiles($_FILES, [
'extensions' => ['jpg', 'png', 'gif'],
'maxSize... | true |
59b09c8e9361a341f5770a924d093216ec70c902 | PHP | imutafchiev94/Programing-Basics-PHP | /Conditional Statements/14. Pets.php | UTF-8 | 628 | 3.296875 | 3 | [] | no_license | <?php
$days = intval(readline());
$foodInKg = intval(readline());
//in kilograms
$foodForDogPerDay = floatval(readline());
//in kilograms
$foodForCatPerDay = floatval(readline());
//in grams
$foodForTurtlePerDay = floatval(readline());
//in kilograms
$allNeededFoodPerDay = $foodForCatPerDay + $foodForDogPerDay + ($fo... | true |
f6393eeb7e136e972a0ef963aa45dcf70d17d5e6 | PHP | ThibaudDauce/EloquentVariableModelConstructor | /tests/ThibaudDauce/EloquentVariableModelConstructor/VariableModelConstructorTraitTest.php | UTF-8 | 2,922 | 2.921875 | 3 | [
"MIT"
] | permissive | <?php
use ThibaudDauce\EloquentVariableModelConstructor\VariableModelConstructorTrait;
use Illuminate\Database\Eloquent\Model as Eloquent;
class VariableModelConstructorTraitTest extends PHPUnit_Framework_TestCase {
public $character;
public $characterCustomClassnameField;
public $warrior;
public function se... | true |
d80d9ba0bb6b0e313cce160247b5001e2b776380 | PHP | StefftheEmperor/3rei | /Structure/Classes/Form.php | UTF-8 | 2,078 | 2.984375 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: stefan
* Date: 28.05.15
* Time: 17:22
*/
namespace Structure\Classes;
use Structure\Classes\AbstractStructure;
use Request\Classes\Request\Post;
use Structure\Interfaces\Value;
use Structure\Classes\Form\Input\Hidden;
/**
* Class Form
* @package Structure\Classes
*/
c... | true |
9b91c7bad11a7f6dda95a1b0743d445426d7616a | PHP | petewurster/cis-244 | /wurster_lab03/index.php | UTF-8 | 2,131 | 2.96875 | 3 | [] | no_license | <?php
$navs = [
'page1' => 'p_cubensis',
'page2' => 'p_tampanensis',
'page3' => 'a_muscaria'
];
$pageData = [
'p_cubensis' => [
'image' => 'p_cubensis.jpg',
'text' => [
'p_cubensis fact 1 of 2',
'p_cubensis fact 2 of 2'
]
],
'p_tampanensis' => [
'image' => 'p_tampanensis.jpg',
'text' => [
'p_... | true |
d74f4e5afd40e7328b9c404ff827fa771f43a683 | PHP | bpolaszek/hostname-extractor | /src/Visitor/SuffixVisitor.php | UTF-8 | 1,605 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
namespace BenTools\HostnameExtractor\Visitor;
use BenTools\HostnameExtractor\ParsedHostname;
use BenTools\HostnameExtractor\SuffixProvider\NaiveSuffixProvider;
use BenTools\HostnameExtractor\SuffixProvider\SuffixProviderInterface;
use BenTools\Violin\Violin;
use function BenTools\Violin\string;
/**
* Class Su... | true |
46aa65506ff6afa6f076c4c24bb4f658ef2df376 | PHP | MariangelaEscobarMarcondes/TicketHappy | /controller/ContatoController.php | UTF-8 | 3,618 | 2.671875 | 3 | [] | no_license | <?php
class ContatoController extends Controller{
public function __call($m,$a){
$this->view->renderizar("erro");
}
public function cadastroContato(){
$this->view->renderizar("header");
$this->view->renderizar("contato");
$this->view->renderizar("footer");
}
... | true |
1941241b64d7ab5805a6189ab79ea24905546c86 | PHP | hassanhitleap1/desgin_pattern | /Creational/AbstractFacrory2/FactoryFile.php | UTF-8 | 566 | 2.796875 | 3 | [] | no_license | <?php
namespace Creational\AbstractFacrory2;
class FactoryFile
{
public function uploadFileXls(){
$file= new XLSFile(1);
$file->set_name("name xls");
$file->upload_file();
return $file;
}
public function uploadFileCSV(){
$file= new CSVFile(1);
$file->set_... | true |
12b03e31a1562e0230f7fdcdba537ddb8c20080e | PHP | HydraWiki/hydrawiki-codesniffer | /HydraWiki/Sniffs/WhiteSpace/SpaceBeforeSingleLineCommentSniff.php | UTF-8 | 4,752 | 3.078125 | 3 | [
"MIT"
] | permissive | <?php
/**
* Curse Inc.
* SpaceBeforeSingleLineCommentSniff
*
* Verify comments are preceded by a single space.
*
* This file was copied from MediaWiki Codesniffer before being modified
* File: MediaWiki/Sniffs/WhiteSpace/SpaceBeforeSingleLineCommentSniff.php
* From repository: https://github.com/wikimedia/media... | true |
92c9d77fe648f0e0d3d3d012b5bd07618603d504 | PHP | secondred-fleckner/php-imageprocessing | /Media/Filtering/MeanRemoval.php | UTF-8 | 662 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
namespace lib\Media\Filtering;
class MeanRemoval
extends \lib\Media\Filtering\AbstractImageFilter
implements \lib\Interfaces\InterfaceImageFilter
{
/**
* MeanRemoval::__construct()
*
* @param mixed $args (no Params)
... | true |