Created
June 18, 2017 11:14
-
-
Save praagyajoshi/71dc825b12dfa91e8847e46263c610e6 to your computer and use it in GitHub Desktop.
Config file for Kayako Twitter App
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 | |
// App secrets and other constants | |
$ENV = []; | |
$ENV['TWITTER_CONSUMER_KEY'] = '-- snipped --'; | |
$ENV['TWITTER_CONSUMER_SECRET'] = '-- snipped --'; | |
// Autoloader | |
function twitterAppAutoloader($class) { | |
$class = lcfirst($class); | |
$class = str_replace( | |
array( '\\', '/' ), | |
DIRECTORY_SEPARATOR, | |
__DIR__.'/..'.DIRECTORY_SEPARATOR.$class.'.php' | |
); | |
// Get file real path | |
// (returns false is file doesn't exist) | |
if(false === ($class = realpath($class))) { | |
// File not found | |
return false; | |
} else { | |
// File found - include it | |
require_once($class); | |
return true; | |
} | |
} | |
// Registering the autoloader | |
spl_autoload_register('twitterAppAutoloader'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment