This file contains 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 | |
class Deprecated | |
{ | |
/** | |
* Shortcut for triggering a deprecation warning for a method. | |
* | |
* Example: | |
* class Foo | |
* { |
This file contains 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 Aws\S3\S3Client; | |
use League\Flysystem\Filesystem; | |
use League\Flysystem\Adapter\AwsS3 as Adapter; | |
$client = S3Client::factory(array( | |
'key' => '[your key]', | |
'secret' => '[your secret]', | |
'region' => '[aws-region]' | |
)); |
This file contains 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 CKEDITORPluginExtras = false; | |
if (typeof(CKEDITOR) != 'undefined' ) { | |
CKEDITOR.on('instanceReady',function(event, instance){ | |
if (CKEDITORPluginExtras) { | |
return; | |
} | |
var config = event.editor.config; | |
CKEDITOR.instances.body.destroy(); |
This file contains 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 MyApp\Response; | |
use Symfony\Component\HttpFoundation\Response; | |
class CsvResponse extends Response | |
{ | |
protected $data; |
This file contains 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 | |
// This line needs to be called after initialize but before run | |
$app['upload'] = $app->extend( | |
'upload', | |
function ($handler, $app) { | |
if ($app['request']->get('contenttypeslug') && $app['request']->get('id')) { | |
$handler->setPrefix("/".$app['request']->get('contenttypeslug')."/".$app['request']->get('id')); | |
} | |
This file contains 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
$app['upload'] = $app->share( | |
$app->extend( | |
'upload', | |
function ($uploadHandler) { | |
$uploadHandler->setSanitizerCallback( | |
function ($filename) { | |
// Do things with filename string here. | |
return $filename; | |
} | |
); |
This file contains 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
$app['upload'] = $app->share( | |
$app->extend( | |
'upload', | |
function ($uploadHandler) { | |
$uploadHandler->addRule('size', ['max' => '2M']) | |
return $uploadHandler; | |
} | |
) |
This file contains 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 MyApp\Twig; | |
use Twig_Extension; | |
use Twig_SimpleFilter; | |
class TwigExtension extends Twig_Extension | |
{ | |
public $app; |
This file contains 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 Bundle\Site; | |
use Bolt\Storage\Entity\Content; | |
use Bolt\Extension\SimpleExtension; | |
use Bolt\Events\StorageEvent; | |
use Bolt\Events\StorageEvents; | |
/** | |
* Site bundle extension loader. |
This file contains 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 MyNewApp\Command; | |
use Symfony\Component\Console\Command\Command; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
use Symfony\Component\Console\Input\InputOption; | |
use Bolt\Application; |
NewerOlder