Skip to content

Instantly share code, notes, and snippets.

@praagyajoshi
Created June 18, 2017 11:14
Show Gist options
  • Save praagyajoshi/71dc825b12dfa91e8847e46263c610e6 to your computer and use it in GitHub Desktop.
Save praagyajoshi/71dc825b12dfa91e8847e46263c610e6 to your computer and use it in GitHub Desktop.
Config file for Kayako Twitter App
<?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