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 | |
// Allows changing password without e-mail. | |
// Place this script in the root of your Elgg install | |
$maxAge = 60; | |
if ((time() - filemtime(__FILE__)) > $maxAge) { | |
die("Touch this file for $maxAge seconds of use. You'll need a valid username and the value of the password" | |
." column in the users_entity table."); | |
} else { |
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 | |
/** | |
* Get a string of useful info about a callback | |
* | |
* E.g. "function_name", "Static::method", "(Dynamic)->method", "(Closure path/to/file.php:23)" | |
* | |
* @param callable $callable | |
* @param string $file_root If provided, this will be stripped from the beginning of the file path for Closures | |
* @return string |
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
# Use git in /usr/local/git (not the xcode installed one) | |
PATH=/usr/local/git/bin:$PATH | |
export PATH | |
# enable git completion and the __git_ps1 function | |
if [ -f /usr/local/git/contrib/completion/git-completion.bash ]; then | |
source /usr/local/git/contrib/completion/git-completion.bash | |
fi | |
if [ -f /usr/local/git/contrib/completion/git-prompt.sh ]; then |
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 | |
// Set entity URLs in both Elgg 1.8 and 1.9 without deprecation notices | |
if (function_exists('elgg_get_version')) { | |
elgg_register_plugin_hook_handler('entity:url', 'object', function ($h, $t, $v, $p) { | |
if ($p['entity']->subtype === 'my_subtype') { | |
return my_subtype_url_handler($p['entity']); | |
} | |
}); | |
} else { |
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 UFCOE\Elgg; | |
/** | |
* Preload entities that are related to a propert(y|ies) of a given list of entities | |
* | |
* E.g. You need to display 10 blog posts, you know you're going to need to load the owners | |
* and containers, but Elgg is not smart enough to know that; it has to make a bunch of individual | |
* queries as those needs are discovered. This allows scanning the fetched blog objects and preloading |
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 | |
/** | |
* Enables full PSR-0 class autoloading out of /classes directory | |
* | |
* Usage in start.php: | |
* | |
* if (!function_exists('elgg_get_version')) { | |
* require_once __DIR__ . '/19-autoloader.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 | |
namespace UFCOE\Elgg; | |
/** | |
* Allows modeling a unique set of integers on top of entity metadata | |
*/ | |
class MetadataSet | |
{ | |
/** |
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 UFCOE\Elgg; | |
/** | |
* Utilities for altering queries based on matching optional/required tags | |
*/ | |
class TagUtil { | |
/** |
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 UFCOE\Elgg; | |
/** | |
* Populate an ACL based on users and existing ACLs (bypasses Elgg API: does not induce plugin hooks) | |
* | |
* <code> | |
* $populator = new AclPopulator(23); // target | |
* $populator->addAcls(array(123, 456)); // merge in a couple existing lists |