homepagePHP/app/Home/Controller/IndexController.class.php

74 lines
2.4 KiB
PHP
Executable File

<?php
namespace Home\Controller;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
use Gy_Library\DBCont;
use Gy_Library\HomeController;
class IndexController extends HomeController
{
public function index(){
$this->display('index');
// return view('index.html');
}
// public function index()
// {
// $this->meta_title='首页';
// $index_banner =D('IndexBanner')->where(['status'=>DBCont::YES_BOOL_STATUS])->order('sort asc,id desc')->select();
// $index_banner = !empty($index_banner) ? $index_banner : [];
// $this->index_banner =$index_banner;
// $keyword_res = D('Keywords')->where(['status'=>DBCont::YES_BOOL_STATUS])->order('total_time desc,sort asc,id asc')->select();
// $this->keyword =$keyword_res;
// //分享标题
// $this->share_title=C('WEB_SITE_TITLE');
// $this->display();
// }
public function test(){
echo "test" . PHP_EOL;
// $symLinks = RegisterContainer::getRegisterSymLinks();
// foreach($symLinks as $link => $source){
// self::makeIgnore($link);
//
// if(file_exists($link)){
// echo $link . ' exists' . PHP_EOL;
// }
// else{
//
// $relative_path = getRelativePath(normalizeRelativePath($source), normalizeRelativePath($link));
// $r = symlink($relative_path, $link);
// if($r){
// echo 'create link: '. $link . ' => ' . $relative_path . PHP_EOL;
// }
// else{
// echo 'create link: '. $link . ' failure !' . PHP_EOL;
// }
// }
// }
}
// private function makeIgnore($link){
// $path_info = pathinfo($link);
// if(file_exists($path_info['dirname'] . '/.gitignore')){
// $content = file_get_contents($path_info['dirname'] . '/.gitignore');
// if(!preg_match('#(^/|[\n\r]+?/)' . $path_info['basename'] . '#', $content)){
// file_put_contents($path_info['dirname'] . '/.gitignore', PHP_EOL . '/' . $path_info['basename'], FILE_APPEND);
// }
// }
// else{
// file_put_contents($path_info['dirname'] . '/.gitignore', '/' . $path_info['basename']);
// }
// }
}