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
# Block access to any file or directory that begins with a period | |
location ~ /\. { | |
deny all; | |
} | |
# Block access to any software identifying txt files | |
location ~ /(COPYRIGHT|LICENSE|README|htaccess)\.txt { | |
deny all; | |
} | |
# Block access to protected assets directories | |
location ~ ^/site(-[^/]+)?/assets/(.*\.php|backups|cache|config|install|logs|sessions|tmp) { |
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 Valet\Drivers\Custom; | |
use Valet\Drivers\ValetDriver; | |
class ProcessWireValetDriver extends ValetDriver | |
{ | |
private array $possiblePaths = ['', '/public_html', '/web']; |
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 FileFinder | |
{ | |
/** | |
* Glob files with braces support. | |
* | |
* @param string $pattern | |
* @param int $flags | |
* |
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 ProcessWire; | |
/** | |
* HOOKS : IMAGE | |
*/ | |
foreach (["array", "json", "alt", "srcset", "sizes", "thumbnail"] as $index => $hook) { | |
wire()->addHookProperty("Pageimage::{$hook}", function(HookEvent $event) use($hook) { | |
if ($event->object instanceof Pageimage) { |
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 UbiquityValetDriver extends BasicValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName |
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 ConfigurableValetDriver | |
* | |
* You can change paths and files arrays via creating a config file under your site path ".valet/index.php" | |
* | |
* This files must return an array like example. | |
* | |
* return ["paths" => ["foo", "bar"], "files" => ["bar.php", "foo.php"]]; |
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 ProcessString { | |
public static $allowedFunctions = [ | |
"pages", "page", "config", "modules", "user", "users", | |
"session", "fields", "templates", "database", "permissions", "roles", | |
"sanitizer", "datetime", "files", "cache", "languages", "input", | |
"inputGet", "inputPost", "inputCookie", "urls", "paths", "profiler", "region", | |
"label", "description", "notes" | |
]; |
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 | |
/** | |
* AvbMarkupOutput | |
* | |
* @param array $configs | |
* @param null $page | |
* @return string | |
*/ | |
function AvbMarkupOutput($configs=array(), $page=null) { | |
$output = ""; |
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
/** | |
* Get last modified page modified date from given $id, $parent_id, $templates_id or from all | |
* | |
* @param bool $id | |
* @param bool $parent_id | |
* @param bool $templates_id | |
* @return mixed|string | |
*/ | |
function getLastModified($id=false, $parent_id=false, $templates_id=false) { | |
if(!is_null($id)) { |