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 | |
/** | |
* Check if a request originated from a crawler, spider, or bot. | |
* | |
* @param null|string $userAgent | |
* @param array $identifiers | |
* @return bool | |
*/ | |
if (!function_exists('isBot')) { | |
function isBot($userAgent = null, $identifiers = array()) |
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
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
// Allows you to load JavaScript files programatically from within other JavaScript files in your project. | |
// | |
// Instructions: | |
// 1. Include this file before all other scripts in your project. | |
// 2. Call jsLoader.load() or jsLoader.loadAsync() from within your scripts passing a single JS file path or | |
// array of multiple JS paths to load into your script at runtime. | |
// | |
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
const jsLoader = { |
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 | |
$a = new A(); | |
$reflection = new \ReflectionClass($a); | |
$property = $reflection->getProperty('privateProperty'); | |
$property->setAccessible(true); | |
$property->setValue($a, 'new-value'); | |
echo $a->getPrivateProperty(); | |
//outputs: |