Skip to content

Instantly share code, notes, and snippets.

@adjaya-dev
adjaya-dev / example.php
Created January 27, 2020 23:12 — forked from hikari-no-yume/example.php
function chaining for PHP 7
<?php declare(strict_types=1);
require_once "✨.🐘";
✨($_)->strlen("foo")->var_dump($_);
@adjaya-dev
adjaya-dev / csv-to-json.php
Created September 7, 2019 10:06 — forked from robflaherty/csv-to-json.php
Convert CSV to JSON
<?php
/*
* Converts CSV to JSON
* Example uses Google Spreadsheet CSV feed
* csvToArray function I think I found on php.net
*/
header('Content-type: application/json');
// Set your CSV feed
@adjaya-dev
adjaya-dev / fm.php
Created August 21, 2019 21:31 — forked from heiswayi/fm.php
Single PHP File Manager Script - Screenshot: https://i.imgur.com/4OtrKUz.png
<?php
/**
* File Manager Script
*/
// Default language ('en' and other from 'filemanager-l10n.php')
$lang = 'en';
// Auth with login/password (set true/false to enable/disable it)
$use_auth = true;
@adjaya-dev
adjaya-dev / DecoratorAbstract.php
Created May 2, 2019 20:18 — forked from CMCDragonkai/DecoratorAbstract.php
PHP: DecoratorAbstract - Allows the creation of flexible nested decorators.
<?php
/**
* DecoratorAbstract allows the creation of flexible nested decorators. All decorators must extend from DecoratorAbstract.
* Decorators can be stacked. They can also have methods that overwrite each other.
* Decorators can omit methods that parent decorators have defined and/or child decorators have defined.
* Methods will cascade to the original child object.
* Properties will read and set from the original child object except when your instance has the property defined.
*/
abstract class DecoratorAbstract{
@adjaya-dev
adjaya-dev / generator.php
Created January 8, 2019 18:28 — forked from tawfekov/generator.php
Doctrine2 Generate Entities form Existing Database
<?php
include '../vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
$classLoader->register();
// config
$config = new \Doctrine\ORM\Configuration();
@adjaya-dev
adjaya-dev / composer.json
Created January 11, 2018 21:12 — forked from argentinaluiz/composer.json
Doctrine configuration for Zend-Expressive
....
"zendframework/zend-stdlib": "~2.7.0",
"zendframework/zend-servicemanager": "~2.7.3",
"doctrine/doctrine-orm-module": "0.10.0",
....