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 | |
include_once __DIR__ . "/vendor/autoload.php"; | |
\Pimcore\Bootstrap::setProjectRoot(); | |
\Pimcore\Bootstrap::startupCli(); | |
use Pimcore\Model\DataObject; | |
$search = 'O:30:"Pimcore\Model\Object\Data\Link"'; |
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 AppBundle\EventListener; | |
use Pimcore\Event\BundleManager\PathsEvent; | |
use Pimcore\Event\BundleManagerEvents; | |
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |
class JqueryAdminListener implements EventSubscriberInterface | |
{ |
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 localMigration; | |
include_once __DIR__ . "/vendor/autoload.php"; | |
\Pimcore\Bootstrap::startupCli(); | |
use Pimcore\Bundle\EcommerceFrameworkBundle\PimcoreEcommerceFrameworkBundle; | |
use Pimcore\Db; |
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 | |
$client = new \Zend\XmlRpc\Client('https://example.com/rpc/xmlrpc'); // INSERT your hostname | |
$token = $client->call('confluence2.login', ['USERNAME','PASSWORD']); // INSERT your user + pass | |
try { | |
$profilePictureData = file_get_contents('/path/to/your/image/file.jpg'); // INSERT path to the file | |
$profilePictureData = new \Zend\XmlRpc\Value\Base64($profilePictureData); | |
// REPLACE "confluence-username" with the username of the user to update | |
$result = $client->call('confluence2.addProfilePicture', [$token, 'confluence-username', 'file.jpg', 'image/jpg', $profilePictureData]); |
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 AppBundle\EventListener; | |
use Pimcore\Event\Model\AssetEvent; | |
class AssetMetadataListener | |
{ | |
public function onAssetCreate(AssetEvent $event) | |
{ |
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 | |
include_once 'pimcore/config/startup_cli.php'; | |
$classList = new \Pimcore\Model\DataObject\ClassDefinition\Listing(); | |
$classes = $classList->load(); | |
foreach ($classes as $class) { | |
$class->save(); | |
} |
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 | |
\Pimcore::getEventManager()->attach("object.preUpdate", function (\Zend_EventManager_Event $event) { | |
$newObject = $event->getTarget(); | |
\Pimcore::collectGarbage(); | |
$oldObject = \Pimcore\Model\Object::getById($newObject); | |
if($newObject->getKey() != $oldObject->getKey()) { | |
// ... | |
} |
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 | |
\Pimcore::getEventManager()->attach("admin.controller.postInit", function ($event) { | |
$controller = $event->getTarget(); | |
if($controller->getParam("controller") == "object" && $controller->getParam("action") == "update") { | |
$object = \Pimcore\Model\Object::getById($controller->getParam("id")); | |
// do with the object whatever you want | |
// later in ObjectController::updateAction() the pimcore admin will get the same instance of this object | |
// since ::getById() returns always the same object for an ID |
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
pimcore.registerNS("pimcore.plugin.test"); | |
pimcore.plugin.test = Class.create(pimcore.plugin.admin, { | |
getClassName: function() { | |
return "pimcore.plugin.test"; | |
}, | |
initialize: function() { | |
pimcore.plugin.broker.registerPlugin(this); | |
}, |
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
// PUT THE FOLLOWING INTO YOUR "BUCKET POLICY" AND RENAME 'pimcore-demo' WITH THE NAME OF YOUR S3-BUCKET | |
{ | |
"Version": "2008-10-17", | |
"Id": "Policy1380877762691", | |
"Statement": [ | |
{ | |
"Sid": "Stmt1380877761162", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" |
NewerOlder