| #0 | Abraham\TwitterOAuth\TwitterOAuth->oauth(oauth/request_token, Array([oauth_callback] => http://dada-data.net/en/tweet/signin)) /home/block-dada/dada-website/apps/frontend/Controllers/TweetController.php (25) <?php
namespace Akufen\Frontend\Controllers;
use Akufen\Frontend\Helpers\Pages;
class TweetController extends AbstractHacktions
{
/**
* Dada Tweet
*/
public function indexAction()
{
// Request an oauth token for authentication
$config = $this->di->getConfig();
$twitter = new \Abraham\TwitterOAuth\TwitterOAuth(
$config->application->twitter->consumerKey,
$config->application->twitter->consumerSecret
);
$twitter->setTimeouts(10, 15);
$twitterTokens = $twitter->oauth(
'oauth/request_token',
array('oauth_callback' => 'http://'.$_SERVER['HTTP_HOST'].'/'.$this->language.'/tweet/signin')
);
// Store the twitter callback
$this->session->set('twitterCallback', $this->request->get('_url').'?skip=true');
// Store the token for future validation
if(!$this->session->has('twitterToken')) {
$this->session->set('twitterToken', $twitterTokens['oauth_token']);
$this->session->set('twitterTokenSecret', $twitterTokens['oauth_token_secret']);
}
// Store temporary tokens for view rendering
$this->view->twitterTokens = $twitterTokens;
// Build seo meta tags
Pages::buildSeo($this->node, '/img/meta/fb/tweet.jpg');
// Handle the rest of the hacktion
$this->handleHacktion('tweet');
}
/**
* Twitter Signin Action
*/
public function twitterSigninAction()
{
// Retrieve the twitter params
$params = $this->request->get();
// Validate the access token with the verifier
try {
$config = $this->di->getConfig();
$twitter = new \Abraham\TwitterOAuth\TwitterOAuth(
$config->application->twitter->consumerKey,
$config->application->twitter->consumerSecret,
$this->session->get('twitterToken'),
$this->session->get('twitterSecret')
);
$twitter->setTimeouts(10, 15);
$response = $twitter->oauth(
'oauth/access_token',
array(
'oauth_verifier' => $params['oauth_verifier'],
'oauth_token' => $params['oauth_token']
)
);
} catch (\Exception $e) {
return $this->dispatcher->forward(array(
'controller' => 'error',
'action' => 'show404'
));
}
// Store twitter connect information
$this->session->set('twitterId', $response['user_id']);
$this->session->set('twitterUsername', $response['screen_name']);
$this->session->set('twitterToken', $response['oauth_token']);
$this->session->set('twitterSecret', $response['oauth_token_secret']);
// Redirect the user to twitter hacktions
return $this->response->redirect($this->session->get('twitterCallback'));
}
/**
* Twitter Intent Action
*/
public function tweetIntentAction()
{
// Request valid parameters
if(!$this->session->has('twitterToken') || !$this->request->isAjax() || !$this->request->hasPost('message'))
return $this->dispatcher->forward(array(
'controller' => 'error',
'action' => 'show404'
));
// Disable view rendering
$this->view->disable();
// Handle new twitter request
$config = $this->di->getConfig();
$twitter = new \Abraham\TwitterOAuth\TwitterOAuth(
$config->application->twitter->consumerKey,
$config->application->twitter->consumerSecret,
$this->session->get('twitterToken'),
$this->session->get('twitterSecret')
);
$twitter->setTimeouts(10, 15);
// Store message locally
$message = $this->request->getPost('message');
// Attempt to find #dadadata
if(!preg_match('/\#dadadata/mi', $message)) {
$message = trim($message).' #dadadata';
}
// Post the message for the user
$twitter->post('statuses/update', array(
'status' => $message
));
}
}
|
| #1 | Akufen\Frontend\Controllers\TweetController->indexAction(en, tweet) |
| #2 | Phalcon\Dispatcher->callActionMethod(Object(Akufen\Frontend\Controllers\TweetController), indexAction, Array([0] => en, [1] => tweet)) |
| #3 | Phalcon\Dispatcher->dispatch() |
| #4 | Phalcon\Mvc\Application->handle() /home/block-dada/dada-website/public/index.php (84) <?php
try {
// Create dependency injector
$di = new \Phalcon\DI\FactoryDefault();
$di->set('config', function() {
return include __DIR__ . '/../config.php';
});
// Retrieve instance of configuration
$config = $di->getConfig();
// Set development flags
if(!$config->application->production) {
// Report all error
error_reporting(E_ALL);
// Create a new debug listener
$debug = new \Phalcon\Debug();
$debug->listen();
}
// Url service configuration
$di->set('url', function() use($config) {
$url = new \Phalcon\Mvc\Url();
$url->setBaseUri($config->application->baseUri);
return $url;
});
// Session service configuration
$di->set('session', function() {
$session = new \Phalcon\Session\Adapter\Files();
$session->start();
return $session;
}, true);
// Configure router
$di->set('router', function() use($config) {
$router = new \Phalcon\Mvc\Router();
$router->setDefaultModule($config->application->defaultModule);
$router->removeExtraSlashes(true);
// Iterate and mount router groups from the configuration
foreach($config->application->routers as $info) {
require_once $info->path;
$group = new $info->className;
$router->mount($group);
}
return $router;
}, true);
// Modules configuration
$routerAdapater = array();
$di->set('modules', function() use($config) {
$modules = array();
foreach($config->modules->toArray() as $module) {
// Find out if the module is a composer package
if(substr($module, 0, 1) == '/') {
$modulePath = '..' . $module;
} else $modulePath = '../vendor/' . $module . '/src';
// Find the module name
$segments = explode('/', $module);
$moduleName = end($segments);
// Build the module configuration array
$modules[$moduleName] = array(
'className' => 'Akufen\\' . ucfirst($moduleName). '\\Module',
'path' => $modulePath . '/Module.php'
);
}
return $modules;
});
// Application configuration
$application = new \Phalcon\Mvc\Application();
$application->setDI($di);
$application->registerModules($di->getModules());
// Handle the request
echo $application->handle()->getContent();
} catch (Phalcon\Exception $e) {
echo $e->getMessage();
} catch (PDOException $e) {
echo $e->getMessage();
}
|
| Key | Value |
|---|---|
| _url | /en/tweet |
| Key | Value |
|---|---|
| REDIRECT_HTTPS | on |
| REDIRECT_SSL_TLS_SNI | dada-data.net |
| REDIRECT_STATUS | 200 |
| HTTPS | on |
| SSL_TLS_SNI | dada-data.net |
| HTTP_USER_AGENT | CCBot/2.0 (https://commoncrawl.org/faq/) |
| HTTP_ACCEPT | text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 |
| HTTP_ACCEPT_LANGUAGE | en-US,en;q=0.5 |
| HTTP_IF_MODIFIED_SINCE | Wed, 08 Oct 2025 04:06:58 GMT |
| HTTP_ACCEPT_ENCODING | br,gzip |
| HTTP_HOST | dada-data.net |
| HTTP_CONNECTION | Keep-Alive |
| PATH | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
| SERVER_SIGNATURE | <address>Apache/2.4.10 (Debian) Server at dada-data.net Port 443</address>\n |
| SERVER_SOFTWARE | Apache/2.4.10 (Debian) |
| SERVER_NAME | dada-data.net |
| SERVER_ADDR | 143.198.45.49 |
| SERVER_PORT | 443 |
| REMOTE_ADDR | 18.97.14.83 |
| DOCUMENT_ROOT | /home/block-dada/dada-website/public |
| REQUEST_SCHEME | https |
| CONTEXT_PREFIX | |
| CONTEXT_DOCUMENT_ROOT | /home/block-dada/dada-website/public |
| SERVER_ADMIN | supportt@akufen.ca |
| SCRIPT_FILENAME | /home/block-dada/dada-website/public/index.php |
| REMOTE_PORT | 50604 |
| REDIRECT_QUERY_STRING | _url=/en/tweet |
| REDIRECT_URL | /en/tweet |
| GATEWAY_INTERFACE | CGI/1.1 |
| SERVER_PROTOCOL | HTTP/1.1 |
| REQUEST_METHOD | GET |
| QUERY_STRING | _url=/en/tweet |
| REQUEST_URI | /en/tweet |
| SCRIPT_NAME | /index.php |
| PHP_SELF | /index.php |
| REQUEST_TIME_FLOAT | 1762716265.634 |
| REQUEST_TIME | 1762716265 |
| # | Path |
|---|---|
| 0 | /home/block-dada/dada-website/public/index.php |
| 1 | /home/block-dada/dada-website/config.php |
| 2 | /home/block-dada/dada-website/apps/frontend/Router.php |
| 3 | /home/block-dada/dada-website/apps/contest/Router.php |
| 4 | /home/block-dada/dada-website/vendor/akufen/backend/src/Router.php |
| 5 | /home/block-dada/dada-website/apps/frontend/Module.php |
| 6 | /home/block-dada/dada-website/vendor/akufen/backend/src/Services/Translations.php |
| 7 | /home/block-dada/dada-website/vendor/akufen/backend/src/Services/Dispatcher.php |
| 8 | /home/block-dada/dada-website/vendor/akufen/backend/src/Models/Contents/Entities.php |
| 9 | /home/block-dada/dada-website/vendor/akufen/backend/src/Models/Entities.php |
| 10 | /home/block-dada/dada-website/vendor/akufen/backend/src/Models/Base.php |
| 11 | /home/block-dada/dada-website/vendor/akufen/backend/src/Models/Contents/Groups.php |
| 12 | /home/block-dada/dada-website/vendor/akufen/backend/src/Models/Groups.php |
| 13 | /home/block-dada/dada-website/vendor/akufen/backend/src/Models/Contents/Nodes.php |
| 14 | /home/block-dada/dada-website/vendor/akufen/backend/src/Models/Nodes.php |
| 15 | /home/block-dada/dada-website/vendor/akufen/backend/src/Models/StdBase.php |
| 16 | /home/block-dada/dada-website/vendor/akufen/backend/src/Models/NodeInterface.php |
| 17 | /home/block-dada/dada-website/vendor/akufen/backend/src/Helpers/Strings.php |
| 18 | /home/block-dada/dada-website/apps/frontend/Controllers/PagesController.php |
| 19 | /home/block-dada/dada-website/apps/frontend/Controllers/AbstractHacktions.php |
| 20 | /home/block-dada/dada-website/apps/frontend/Controllers/ControllerBase.php |
| 21 | /home/block-dada/dada-website/vendor/akufen/backend/src/Controllers/FrontendController.php |
| 22 | /home/block-dada/dada-website/vendor/mobiledetect/mobiledetectlib/namespaced/Detection/MobileDetect.php |
| 23 | /home/block-dada/dada-website/vendor/mobiledetect/mobiledetectlib/Mobile_Detect.php |
| 24 | /home/block-dada/dada-website/apps/frontend/Controllers/TweetController.php |
| 25 | /home/block-dada/dada-website/vendor/abraham/twitteroauth/src/TwitterOAuth.php |
| 26 | /home/block-dada/dada-website/vendor/abraham/twitteroauth/src/Config.php |
| 27 | /home/block-dada/dada-website/vendor/abraham/twitteroauth/src/Response.php |
| 28 | /home/block-dada/dada-website/vendor/abraham/twitteroauth/src/HmacSha1.php |
| 29 | /home/block-dada/dada-website/vendor/abraham/twitteroauth/src/SignatureMethod.php |
| 30 | /home/block-dada/dada-website/vendor/abraham/twitteroauth/src/Consumer.php |
| 31 | /home/block-dada/dada-website/vendor/abraham/twitteroauth/src/Request.php |
| 32 | /home/block-dada/dada-website/vendor/abraham/twitteroauth/src/Util.php |
| 33 | /home/block-dada/dada-website/vendor/abraham/twitteroauth/src/TwitterOAuthException.php |
| Memory | |
|---|---|
| Usage | 1048576 |