#0 | PDO->__construct(mysql:host=188.132.151.223;dbname=st_xsdbt;charset=utf8, st_xsdbt, H5VifunEqAvigisawALej2mEgu4uN1, Array([3] => 2)) |
#1 | Phalcon\Db\Adapter\Pdo->connect(Array([host] => 188.132.151.223, [username] => st_xsdbt, [password] => H5VifunEqAvigisawALej2mEgu4uN1, [dbname] => st_xsdbt, [charset] => utf8)) |
#2 | Phalcon\Db\Adapter\Pdo->__construct(Array([host] => 188.132.151.223, [username] => st_xsdbt, [password] => H5VifunEqAvigisawALej2mEgu4uN1, [dbname] => st_xsdbt, [charset] => utf8))
/home/teknoloji/domains/siberteknoloji.com/public_html/config/services.php (105) <?php
use \Phalcon\Db\Adapter\Pdo\Mysql as DbAdapter;
use Phalcon\Mvc\Router\Annotations as Router;
use Phalcon\Mvc\View as View;
use Phalcon\Mvc\View\Engine\Volt as VoltEngine;
use Phalcon\Flash\Direct as DirectMessage;
use Phalcon\Flash\Session as FlashMessage;
use Phalcon\Mvc\Url as UrlResolver;
use Phalcon\DI\FactoryDefault as FactoryDefault;
use Phalcon\Session\Adapter\Files as SessionAdapter;
use Phalcon\Session\Bag as Bag;
use \Phalcon\Mvc\Model\Manager as ModelsManager;
use Repositories\Auth\Auth;
/**
* Bağımlılıkları ekleyebilmek için FactoryDefault sınıfını örnekliyoruz.
*/
$di = new FactoryDefault();
/**
* Session işlemlerini burada yapıyoruz. Önce session tanımlaması, sonra da küme tanımlaması yapıyoruz.
*/
$di['session'] = function(){
$session = new SessionAdapter();
$session->start();
return $session;
};
/* Kullanıcı kümesi */
$di['user_info'] = function(){
return new Bag('user_info');
};
/* İçerik kümesi */
$di['post_info'] = function(){
return new Bag('post_info');
};
/**
* Arayüz işlemlerini volt engine üzerinden yapacağımızı belirtiyoruz.
*/
$di['view'] = function(){
$view = new View();
$view->registerEngines(array(
'.volt' => function($view, $di){
$volt = new VoltEngine($view, $di);
$volt->setOptions(array(
'compiledPath' => __DIR__.'/../cache/volt/',
'compiledSeparator' => '_'
));
$compiler = $volt->getCompiler();
$compiler->addFunction('dateformat', '\Yazar\Shared\Extras\Helpers::dateformat');
$compiler->addFunction('tags', '\Yazar\Shared\Extras\Helpers::tags');
$compiler->addFunction('isset', 'isset');
$compiler->addFunction('check_file', 'file_exists');
$compiler->addFunction('in_array', 'in_array');
$compiler->addFunction('is_null', 'is_null');
$compiler->addFunction('time', 'time');
$compiler->addFunction('date', 'date');
$compiler->addFunction('number_format', 'number_format');
$compiler->addFunction('excerpt', 'mb_substr');
$compiler->addFunction('new_line', '\Yazar\Shared\Extras\Helpers::nl2p');
$compiler->addFunction('filesize', '\Yazar\Shared\Extras\Helpers::filesize');
$compiler->addFunction('length', 'mb_strlen');
$compiler->addFunction('print_r', 'print_r');
$compiler->addFunction('debug', 'var_dump');
$compiler->addFunction('glob', 'glob');
return $volt;
}
));
return $view;
};
$di['router'] = function(){
$router = new Router(false);
require __DIR__.'/routes.php';
return $router;
};
$di['flash'] = function(){
return new FlashMessage(array(
'error' => 'alert alert-danger',
'success' => 'alert alert-success',
'notice' => 'alert alert-info',
'warning' => 'alert alert-warning',
));
};
$di['flashSession'] = function(){
return new FlashMessage(array(
'error' => 'alert alert-danger',
'success' => 'alert alert-success',
'notice' => 'alert alert-info',
'warning' => 'alert alert-warning',
));
};
$di['db'] = function () use ($config){
$connection = new DbAdapter(array(
'host' => $config->database->host,
'username' => $config->database->username,
'password' => $config->database->password,
'dbname' => $config->database->dbname,
'charset' => $config->database->charset
));
return $connection;
};
$di['config'] = function() use ($config){
return $config;
};
/**
* URL tanımlamalarını doğru yapabilmesi için phalcon'a dizin bildirimi yapıyoruz.
*/
$di['url'] = function() use ($config){
$url = new UrlResolver();
$url->setBaseUri($config->url->base);
return $url;
};
$di["modelsManager"] = function(){
return new ModelsManager();
};
$di['auth'] = function(){
return new Auth();
};
$di['crypt'] = function() use($di) {
$crypt = new \Phalcon\Crypt();
$crypt->setMode(MCRYPT_MODE_CFB);
$crypt->setKey('4ga*/s7d-as*dasd4a6s954fga-sd12%%%&');
return $crypt;
};
$di['cookies'] = function () {
$cookies = new \Phalcon\Http\Response\Cookies();
$cookies->useEncryption(false);
return $cookies;
}; |
#3 | Closure->{closure}() |
#4 | Phalcon\Di\Service->resolve(null, Object(Phalcon\Di\FactoryDefault)) |
#5 | Phalcon\Di->get(db, null) |
#6 | Phalcon\Di->getShared(db) |
#7 | Phalcon\Mvc\Model\Manager->_getConnection(Object(Yazar\Shared\Models\Champion: 14), null) |
#8 | Phalcon\Mvc\Model\Manager->getReadConnection(Object(Yazar\Shared\Models\Champion: 14)) |
#9 | Phalcon\Mvc\Model->getReadConnection() |
#10 | Phalcon\Mvc\Model\MetaData\Strategy\Introspection->getMetaData(Object(Yazar\Shared\Models\Champion: 14), Object(Phalcon\Di\FactoryDefault)) |
#11 | Phalcon\Mvc\Model\MetaData->_initialize(Object(Yazar\Shared\Models\Champion: 14), yazar\shared\models\champion-champion, champion, ) |
#12 | Phalcon\Mvc\Model\MetaData->readMetaDataIndex(Object(Yazar\Shared\Models\Champion: 14), 4) |
#13 | Phalcon\Mvc\Model\MetaData->getDataTypes(Object(Yazar\Shared\Models\Champion: 14)) |
#14 | Phalcon\Mvc\Model::_invokeFinder(findFirstByDate, Array([0] => 2024-10-01)) |
#15 | Phalcon\Mvc\Model::__callStatic(findFirstByDate, Array([0] => 2024-10-01))
/home/teknoloji/domains/siberteknoloji.com/public_html/shared/controllers/ControllerBase.php (80) <?php
namespace Yazar\Shared\Controllers;
use Phalcon\Db\RawValue;
use Yazar\Shared\Models\Championships;
use Yazar\Shared\Models\Comments;
use Yazar\Shared\Models\LogsPosts;
use Yazar\Shared\Models\Menu;
use Yazar\Shared\Models\Users as Users,
Yazar\Shared\Models\Posts as Posts,
Yazar\Shared\Models\Champion as Champion,
Yazar\Shared\Models\Categories as Categories,
Yazar\Shared\Models\PrivateMessages as PM;
use Phalcon\Session\Bag as Oturum;
use Repositories\Links\Links;
class ControllerBase extends \Phalcon\Mvc\Controller {
public $customJs, $customCss, $profileInfo, $notifications, $page_meta;
public $sidebar_links, $footer_links;
public function beforeExecuteRoute()
{
if($this->auth->hasRememberMe() && is_null($this->user_info->id))
{
$this->auth->loginWithRememberMe();
}
}
public function category_list($parent)
{
$find = Categories::find(array('conditions'=>"ID={$parent} OR parent={$parent}"));
$return = array();
if($find){
foreach($find->toArray() as $arr)
{
$return[] = $arr['ID'];
}
$return = implode(',', $return);
}else{
$return = 0;
}
return $return;
}
public function initialize() {
$this->page_meta = array(
'description'=>'Yazılım, Robotik, Oyun, Araba ve Teknoloji Haberleri üzerine kişisel blog',
'keywords'=>'teknoloji, teknoloji haberleri, siber teknoloji, teknoloji sitesi'
);
$this->response->setHeader("X-Powered-By", "fatihemre");
if(!is_array($this->post_info->post_view)){
$this->post_info->post_view = array();
}
$users = new Users();
$this->profileInfo = $users->user_info($this->user_info->nick);
$this->customJs = $this->assets->collection('custom-js');
$this->customCss = $this->assets->collection('custom-css');
if($this->profileInfo){
$this->notifications = (object)$this->notifications($this->profileInfo->ID);
if($this->profileInfo->role != $this->user_info->role)
{
$this->response->redirect(['for'=>'blog-logout']);
}
}
$date = strtotime("last Month");
$champion = Champion::findFirstByDate(date("Y-m-01", $date));
if($champion)
$this->view->setVar('champion', $champion);
$subjects = Championships::findByPeriod(date("Y-m-01"));
if($subjects->count() > 0)
{
$this->view->setVar('subjects', $subjects);
}
$ipucu = Posts::find(array('conditions'=>"category_id IN({$this->category_list(7)}) AND status='publish' AND deleted='N'", 'order'=>'created_at DESC', 'limit'=>10));
$links = new Links();
$links->setup('config', true);
$links->setup('end', date("Y-m-d", time()));
$links->setup('max', 10);
$this->sidebar_links = $links->get_sidebar_links();
$this->footer_links = $links->get_links('footer');
//$this->debug($this->menuList('ana-menu')->toArray());
$this->view->setVar('ana_menu', $this->menuList('ana-menu'));
$this->view->setVar('last_comments', $this->last_comments());
$this->view->setVar('sidebar_links', $this->sidebar_links);
$this->view->setVar('footer_links', $this->footer_links);
$this->view->setVar('notifications', $this->notifications);
$this->view->setVar('user_info', (isset($this->user_info->id) && $this->user_info->id > 0) ? $this->user_info : false);
$this->view->setVar('profileInfo', $this->profileInfo);
$this->view->setVar('check_new_message', $this->checkNewMessage());
$this->view->setVar('check_friend_request', $this->checkFriendRequest());
$this->view->setVar('ipucu', $ipucu);
$this->view->setVar('category_menu', $this->category_menu());
$this->view->setVar('version', $this->getVersion());
$this->view->setVar('donate', $this->getDonate());
$this->view->setVar('active_page', $this->router->getActionName());
$this->view->setVar('page_title', "SiberTeknoloji | Teknoloji ve Haber Bloğu");
$this->view->setVar('page_meta', $this->page_meta);
$this->view->setVar('app_config', $this->config->app);
}
protected function used_subjects()
{
$users_posts = Posts::find(["conditions"=>"cs_id > 0 and deleted='N' and status='publish' and user_id=:user_id:", "bind"=>["user_id"=> $this->user_info->id], "columns"=>"cs_id"]);
$hangi_konular = [];
if($users_posts)
{
foreach($users_posts->toArray() as $p)
{
$hangi_konular[] = $p['cs_id'];
}
}
return $hangi_konular;
}
private function menuList($whereis=null)
{
return $this->list_menu($whereis)->getMenu(array('conditions'=>'parent_id=0', 'order'=>'sort ASC'));
}
private function list_menu($key=null)
{
return Menu::findFirstByKey($key);
}
private function last_comments()
{
return Comments::find(array('conditions'=>'status=:status:', 'bind'=>array('status'=>'publish'), 'order'=>'created_at DESC', 'limit'=>10));
}
public function post_view($post,$user=false){
$return = null;
if($user)
{
$log = LogsPosts::findFirst(array('conditions'=>"post_id={$post} and user_id={$user}"));
if($log){
$return = $log->view + 1;
$log->view = $return;
$log->updated_at = new RawValue('now()');
$log->save();
}else{
$return = 0;
$log = new LogsPosts();
$log->post_id = $post;
$log->user_id = $user;
$log->view = 1;
$log->score = 0;
$log->created_ip = $this->request->getClientAddress();
$log->created_at = new RawValue('now()');
$log->updated_at = null;
$log->save();
$update = Posts::findFirst($post);
$update->view = $update->view + 1;
$update->save();
}
}
else
{
if(!in_array($post, $this->post_info->post_view)){
$update = Posts::findFirst($post);
$update->view = $update->view + 1;
$update->save();
$key = $this->post_info->post_view;
$key[] = $post;
$this->post_info->post_view = $key;
}
}
return $return;
}
private function category_menu(){
$category = Categories::find(array('conditions'=>"parent=0 AND ID<>35"));
return $category->count() > 0 ? $category : false;
}
private function notifications($userID){
$notifications = array(
'draft' => Posts::count(array('conditions'=>"status='draft' and user_id={$userID} and deleted='".Posts::NOT_DELETED."'")),
'wait' => Posts::count(array('conditions'=>"status='wait' and user_id={$userID} and deleted='".Posts::NOT_DELETED."'")),
'reject' => Posts::count(array('conditions'=>"status='reject' and user_id={$userID} and deleted='".Posts::NOT_DELETED."'")),
'new_message'=>$this->checkNewMessage(),
'new_friend'=>$this->checkFriendRequest()
);
$notifications['count'] = array_sum($notifications);
return $notifications;
}
private function checkNewMessage(){
if(isset($this->user_info->id) && $this->user_info->id > 0){
$pm = new PM();
return $pm->check_new_message($this->user_info->id);
}
}
private function checkFriendRequest(){
if(isset($this->user_info->id) && $this->user_info->id > 0){
$user = new Users();
return $user->user_friend_request($this->user_info->id);
}
}
public function getDonate()
{
$file = file_get_contents('../public/donate.json');
$result = json_decode($file);
$percent = ( $result->result * 100 ) / $result->total;
$result->percent = round($percent, 2);
return $result;
}
public function getVersion(){
$file = file_get_contents("../public/version.json");
$system = json_decode($file);
return $system->version;
}
public function debug($message) {
echo '<pre>';
is_bool($message) ? var_dump($message) : print_r($message);
echo '</pre>';
exit;
}
} |
#16 | Yazar\Shared\Controllers\ControllerBase->initialize()
/home/teknoloji/domains/siberteknoloji.com/public_html/apps/blog/controllers/IndexController.php (14) <?php
namespace Yazar\Blog\Controllers;
use Yazar\Shared\Controllers\ControllerBase,
Yazar\Shared\Models\Posts as Posts,
Yazar\Shared\Models\Users as Users;
use Yazar\Shared\Extras\Mail as Mail;
use Yazar\Shared\Models\Categories;
class IndexController extends ControllerBase {
public function initialize() {
parent::initialize();
}
public function oldAction($slug)
{
$post = Posts::findFirst(array('conditions'=>"slug='{$slug}' AND status='publish' AND deleted='N'"));
if($post){
$this->response->redirect(array('for'=>'blog-post', 'postID'=>$post->ID, 'slug'=>$post->slug), false,301);
}else{
$this->dispatcher->forward(array("controller" => "index", "action" => "notFound"));
}
}
public function oldAuthorAction($user)
{
$get = Users::findFirst(array('conditions'=>"nick='{$user}'"));
if($get){
$this->response->redirect(array('for'=>'user-profile', 'nick'=>$user), false, 301);
}else{
$this->dispatcher->forward(array("controller" => "index", "action" => "notFound"));
}
}
public function indexAction() {
$this->assets->addCss('assets/css/owl.carousel.css');
$this->assets->addCss('assets/css/owl.theme.css');
$this->assets->addJs('assets/js/owl.carousel.min.js');
/*
$populer = Posts::find(
array(
'conditions'=>"status='publish' AND deleted='N' AND published_at BETWEEN '".date('Y-m-d H:i:s', time()-1209600)."' AND '".date('Y-m-d H:i:s', time())."'",
'order'=>'view DESC',
'limit'=>5
)
);
*/
$populars = Posts::find(
array(
'conditions'=>"status='publish' AND deleted='N' AND published_at BETWEEN '".date('Y-m-d H:i:s', time()-1209600)."' AND '".date('Y-m-d H:i:s', time())."'",
'order'=>'view DESC',
'limit'=>10
)
);
$teknoloji_haberleri = Posts::find(array('conditions'=>"category_id IN({$this->category_list(1)}) AND status='publish' AND deleted='N'", 'order'=>'published_at DESC', 'limit'=>6));
$yazilim = Posts::find(array('conditions'=>"category_id IN({$this->category_list(2)}) AND status='publish' AND deleted='N'", 'order'=>'published_at DESC', 'limit'=>4));
$oyun = Posts::find(array('conditions'=>"category_id IN({$this->category_list(3)}) AND status='publish' AND deleted='N'", 'order'=>'published_at DESC', 'limit'=>3));
$araba = Posts::find(array('conditions'=>"category_id IN({$this->category_list(4)}) AND status='publish' AND deleted='N'", 'order'=>'published_at DESC', 'limit'=>4));
$robotik = Posts::find(array('conditions'=>"category_id IN({$this->category_list(5)}) AND status='publish' AND deleted='N'", 'order'=>'published_at DESC', 'limit'=>3));
$sosyal_medya = Posts::find(array('conditions'=>"category_id IN({$this->category_list(6)}) AND status='publish' AND deleted='N'", 'order'=>'published_at DESC', 'limit'=>3));
// $this->view->setVar('populer', $populer);
$this->view->setVar('populars', $populars);
$this->view->setVar('teknoloji_haberleri', $teknoloji_haberleri);
$this->view->setVar('yazilim', $yazilim);
$this->view->setVar('oyun', $oyun);
$this->view->setVar('sosyal_medya', $sosyal_medya);
$this->view->setVar('robotik', $robotik);
$this->view->setVar('araba', $araba);
}
public function oturumAction() {
}
public function logoutAction(){
$this->auth->remove();
return $this->response->redirect();
}
public function notFoundAction(){
}
}
|
#17 | Yazar\Blog\Controllers\IndexController->initialize() |
#18 | Phalcon\Dispatcher->dispatch() |
#19 | Phalcon\Mvc\Application->handle()
/home/teknoloji/domains/siberteknoloji.com/public_html/public/index.php (50) <?php
/*
$break_maintenance = isset($_COOKIE['break_maintenance']) ? $_COOKIE['break_maintenance'] : false;
if($break_maintenance === false)
{
require 'maintenance.php';
exit;
}
*/
setlocale(LC_TIME, 'tr_TR');
define('__PUBLIC__', __DIR__);
use \Phalcon\Mvc\Application as App;
if(
$_SERVER['REMOTE_ADDR'] == '176.88.151.153' ||
$_SERVER['REMOTE_ADDR'] == '::1' || $_SERVER['REMOTE_ADDR'] == '127.0.0.1')
{
error_reporting(E_ALL);
ini_set('display_errors', 1);
$debug = new \Phalcon\Debug;
$debug->listen();
}
error_reporting(E_ALL);
ini_set('display_errors', 1);
$debug = new \Phalcon\Debug;
$debug->listen();
require __DIR__.'/../vendor/autoload.php';
require __DIR__.'/../config/config.php';
require __DIR__.'/../config/services.php';
require __DIR__.'/../config/loader.php';
$app = new App();
$app->setDI($di);
require __DIR__.'/../config/modules.php';
echo $app->handle()->getContent(); |