View fix_ace.sql
DELIMITER ;; | |
DROP PROCEDURE IF EXISTS fix_ace_order; | |
CREATE PROCEDURE fix_ace_order() | |
BEGIN | |
DECLARE done INT DEFAULT FALSE; | |
DECLARE acl_id INT; | |
DECLARE acl_cursor CURSOR FOR SELECT o.id | |
FROM acl_object_identities o | |
LEFT JOIN acl_entries e ON ( | |
e.class_id = o.class_id AND |
View instantinators.php
<?php | |
/** | |
* Sealed class can not be created directly | |
*/ | |
class Seal | |
{ | |
private function __construct() | |
{ | |
// private ctor prevents from direct creation of instance | |
} |
View FCGIServer.php
<?php | |
use Protocol\FCGI; | |
use Protocol\FCGI\FrameParser; | |
use Protocol\FCGI\Record\BeginRequest; | |
use Protocol\FCGI\Record\EndRequest; | |
use Protocol\FCGI\Record\Params; | |
use Protocol\FCGI\Record\Stdin; | |
use Protocol\FCGI\Record\Stdout; |
View test.php
class MagicMethodAccessor { | |
public function test() | |
{ | |
echo 'Cool'; | |
} | |
final public function __get($name) | |
{ | |
if (method_exists($this, $name)) { | |
$method = (new ReflectionMethod($this, $name))->getClosure($this); |
View Example.php
<?php | |
use Warlock\Annotation\Autowired; | |
class Example | |
{ | |
/** | |
* @Autowired("logger", required=true) | |
* @var LoggerInterface |
View Hydrator.php
<?php | |
class Test { | |
private $a='data'; | |
protected $b=123; | |
public $c=true; | |
} |
View GetterLoggerAspect.php
<?php | |
namespace Aspect; | |
use Go\Aop\Aspect; | |
use Go\Aop\Intercept\MethodInvocation; | |
use Go\Lang\Annotation\After; | |
use Go\Lang\Annotation\AfterThrowing; | |
use Go\Lang\Annotation\Before; | |
use Go\Lang\Annotation\Around; |
View PrivilegedAspect.php
<?php | |
use Go\Aop\Aspect; | |
use Go\Aop\Intercept\MethodInvocation; | |
use Go\Lang\Annotation\Around; | |
/** | |
* Privileged aspect shows the power of privileged advices. | |
* | |
* Privileged advice is running in the scope of target for the current joinpoint |
View test.php
<?php | |
function hello() { | |
echo 'Hello, magic PHP!'; | |
} | |
function getCallback() { | |
return 'hello'; | |
} | |
$result = ${'_'.!$_=getCallback()}(); |
View test.php
<? | |
data : { | |
a: 10; | |
b: { | |
echo 'Test'; | |
}; | |
logic: function() { | |
echo "Hello, world!"; |
NewerOlder