winpty docker exec -it --user root CONTAINER_ID sh
SilverStripe DataObject subclasses cannot override a base class method with an extension point ($this->extend()) and define an extension point themselves.
This will cause extend to be called twice, which can lead to duplication.
<?php
class ExampleDataObject extends DataObject
{
public function getCMSFields()
{upload_max_filesize- The maximum size of an uploaded file.post_max_size- The maximum size of POST data that PHP will accept.memory_limit- The maximum amount of memory a script may consume.max_execution_time- The maximum time in seconds a script is allowed to run before it is terminated by the parser.
http { client_max_body_size }- The maximum allowed size of the client request body, specified in the “Content-Length” request header field. If the size in a request exceeds the configured value, the 413 (Request Entity Too Large) error is returned to the client.
There are a few cases where inline styles would be more appropriate than using SASS or CSS.
- Styling is done in one file, vs adding a class, opening a sass file, and compiling it to css.
- Styling is explicit, no guesswork needs to be done to determine what styles a class would add.
- Style rules are strong, nothing besides !important rules will conflict with them.
- Styles are brief, and the need to come up with a name for a class is avoided.
- Sometimes we just want to add one or a few styles, and a css class would be overkill.
There are cases where sass works better.
- If you need to add 3 or more styles, a class looks cleaner than inline styling does.
- If it is something that is going to be re-used often like in different parts of the project, a class is more appropriate. Doing the styles inline would force you to edit each line to make a change.
This PR originally had info about this, but it was requested out. silverstripe/developer-docs#345
DataObject subclasses' db, has_one, has_many, etc... properties cannot be overridden in DataExtensions.
Instead, you need to use yml to override these.
---
Name: override-db-properties
---
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 | |
| /* Capture original fields by value */ | |
| $orignalFields = FieldList::create($fields->toArray()); | |
| /* Remove all original fields to prevent conflicts with replacement */ | |
| $fields->each(function($field) use (&$fields) { | |
| $fields->remove($field); | |
| }); |
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
| Git bash has issues with certain interactive shell programs | |
| - mongo | |
| - ngrok | |
| - nvim | |
| - gh pr create | |
| These programs can be run, however, by using winpty | |
| Example: | |
| `winpty nvim` |
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
| <?xml version="1.0" encoding="utf-8"?> |
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
| select table_schema 'DB', ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" FROM information_schema.tables where table_schema = 'SS_sitedb' GROUP BY table_schema; |
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
| SELECT * FROM `table_name` | |
| into outfile '/var/lib/mysql-files/output-new.csv' fields terminated by "," enclosed by '"' lines terminated by "\n"; |
NewerOlder