Skip to content

Instantly share code, notes, and snippets.

<?php
namespace App\Forms;
use InvalidArgumentException;
use LogicException;
use SilverStripe\Core\Injector\Injectable;
use SilverStripe\Forms\CheckboxField;
use SilverStripe\Forms\GridField\GridField;
use SilverStripe\Forms\GridField\GridField_ColumnProvider;
@tractorcow
tractorcow / App.php
Last active May 17, 2017 00:40
app-rfc-v2
<?php
namespace SilverStripe\Core;
use Psr\SimpleCache\CacheInterface;
use SilverStripe\Config\Collections\ConfigCollectionInterface;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Control\Session;
use SilverStripe\Core\Config\ConfigLoader;
use SilverStripe\Core\Injector\Injector;
diff --git a/src/Security/InheritedPermissions.php b/src/Security/InheritedPermissions.php
index ae8d203..66a1987 100644
--- a/src/Security/InheritedPermissions.php
+++ b/src/Security/InheritedPermissions.php
@@ -212,6 +212,10 @@ class InheritedPermissions
foreach ([ Versioned::DRAFT, Versioned::LIVE ] as $stage) {
$stageRecords = Versioned::get_by_stage($this->getBaseClass(), $stage)
->byIDs($ids);
+ // Exclude previously calculated records from later stage calculations
+ if ($combinedStageResult) {

Supporting large numbers of files

If your site experiences slow or unusable performance when viewing the "Files" section in the CMS, it could be due to your site containing an excessive number of files. Symptoms of this issue could include the files section failing to load, loading for a long period of time, or a warning notification when attempting to view that section.

The cause of this issue is the file "tree" view in the files section, which does not support the pagination of list view, which allows it to limit visibility to a single page of files.

<html>
<head></head>
<body>
<script type="text/javascript">
dayonle = function(date) {
var d = new Date();
d.setFullYear(date.getFullYear());
d.setMonth(date.getMonth());
d.setDate(date.getDate());
d.setHours(0);
<aside class="sidebar unit size1of4">
<% if $Menu(2) %>
<nav class="secondary">
<% with $Level(1) %>
<h3>
$MenuTitle
</h3>
<ul>
<% include SidebarMenu %>
</ul>

Wprowadzenie

Zobacz docs / pl / index.md na przegląd systemu potokowe.

Uruchomienie polecenia CheckPipelineStatus

Komenda CheckPipelineStatus powinny być prowadzone w sposób ciągły, aby zapewnić, że rurociąg wnioski postępować tak szybko jak oni może. Obecnie osiąga się to z zastosowaniem procesu demon zainstalowanego na /etc/init.d/pipecheck.Kod może być znaleźć w /path/to/webroot/deploynaut/.scripts/pipecheck-initd. Powinna ona zostać zmieniona na /etc/init.d/pipecheck załadować.

Uwaga: OSX można użyć kopii szablonu pipecheck-plist do /Library/LaunchDaemons/deploynaut.pipecheck.plist i zainicjować go z "sudo obciążenia launchctl /Library/LaunchDaemons/deploynaut.pipecheck.plist"

namespace :maintenance do
desc <<-DESC
Enables maintenance page via apache
DESC
task :enable_http do
on_rollback {
run "if [ -f #{current_path}/.htaccess_original ]; then mv #{current_path}/.htaccess_original #{current_path}/.htaccess; fi"
run "if [ -f #{current_path}/maintenance.html ]; then rm #{current_path}/maintenance.html; fi"
}
<?php
class UserFormExtension extends SiteTreeExtension {
public function updateCMSFields(FieldList $fields) {
$grid = $fields->dataFieldByName('Reports');
$config = $grid->getConfig();
$config->addComponent(new GridFieldBulkManager());
}
}