This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Slim; | |
use FastRoute\Dispatcher; | |
use FastRoute\Dispatcher\GroupCountBased; | |
use \Slim\Router2 as Router; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\Response; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use AlanPich\Configurator; | |
use AlanPich\Configurator\FileTypeAdapter; | |
$PROJECT_ROOT = dirname(__FILE__); | |
/////////////////////////////////////////////////////////////////////////////// | |
// Create a configurator |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Example usage | |
if($myMessage instanceof MessageInterface){ | |
// Because $message implements MessageInterface, we | |
// can be absolutely sure that it has a send() method | |
// so don't have to care what it does when sending, | |
// just that it has the capability to send | |
$message->send(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Test 1: Setting a public property directly | |
- 1000000 iterations in 0.49191880226135ms | |
Test 2: Setting a private property via setter method | |
- 1000000 iterations in 11.216212034225ms | |
Test 3: Setting a private property via Reflection | |
- 1000000 iterations in 11.286839008331ms | |
Test 4: Setting a protected property via Reflection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Slender\Module\Controllers; | |
/** | |
* Class Controller | |
* | |
* Provides a base controller setup for executing methods as actions. | |
* | |
* In this case, an action is simply a method on the controller. When the | |
* action is dispatched, $this->beforeAction() is called, passing it any arguments |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var PhantomBridgeClient, | |
net = require('net'); | |
module.exports = PhantomBridgeClient = function(socketPath){ | |
var socket; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The above 2 files (and additionals for all included modules) are merged to form a config cache array | |
*/ | |
return array( | |
'factories' => array( | |
'my.foo.service' => 'Different\Library\Service\Factory\FooServiceFactory' | |
), | |
// Invokables are exactly that - invoke this class as-is | |
'invokables' => array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Rough outline script of extracting MODX elements from the database to | |
* allow them to be version controlled. | |
* | |
* If this script is modified and also run for Snippets, Templates and Plugins | |
* then you can start to VCS their source | |
* | |
* All that would remain would be triggering a cache-refresh after each deployment | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$path_to_modx = '/var/www/modx'; | |
define('MODX_API_MODE',true); | |
require $path_to_modx."/index.php"; | |
/** @var \modX $modx */ | |
// Download Details | |
/** @var string $package_url - URL from the orange 'Download' button on the MODx Extras website */ | |
$package_url = 'http://modx.com/extras/download/?id=512403a2f245547611000025' | |
$package_signature = 'getresources-1.6.0-pl' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** core/components/mcm/processors/mgr/resource/getchildlist.class.php */ | |
/** | |
* Create this file to allow filtering of resources by a parent ID | |
* | |
* @param int $parentId | |
* @return array Array of modResource child elements | |
* | |
*/ | |
if(!class_exists('modObjectGetListProcessor')){ |
NewerOlder