Вынос всего из папки ground в корень
This commit is contained in:
parent
3a7dac3309
commit
00ff581972
|
|
@ -1,4 +1,4 @@
|
||||||
ground/config.php
|
config.php
|
||||||
|
|
||||||
public/img/avatars/*.jpg
|
public/img/avatars/*.jpg
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ function __autoload($className)
|
||||||
|
|
||||||
$loaded = false;
|
$loaded = false;
|
||||||
foreach ($dirs as $dir) {
|
foreach ($dirs as $dir) {
|
||||||
$fileName = dirname(__FILE__) . '/../ground/' . $dir . '/' . $className . '.php';
|
$fileName = App::getBasedir() . $dir . '/' . $className . '.php';
|
||||||
|
|
||||||
if (file_exists($fileName)) {
|
if (file_exists($fileName)) {
|
||||||
$loaded = (bool) include $fileName;
|
$loaded = (bool) include $fileName;
|
||||||
|
|
@ -152,13 +152,14 @@ class App
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Возвращает директорию фреймворка /full/path/ground/
|
* Возвращает директорию фреймворка /full/path/
|
||||||
* @return type
|
* @return type
|
||||||
*/
|
*/
|
||||||
public static function getBasedir()
|
public static function getBasedir()
|
||||||
{
|
{
|
||||||
if (!self::$basedir)
|
if (!self::$basedir) {
|
||||||
self::$basedir = dirname(__FILE__) . '/';
|
self::$basedir = dirname(__FILE__) . '/';
|
||||||
|
}
|
||||||
|
|
||||||
return self::$basedir;
|
return self::$basedir;
|
||||||
}
|
}
|
||||||
|
|
@ -216,7 +217,7 @@ class App
|
||||||
public static function log($logName, $value)
|
public static function log($logName, $value)
|
||||||
{
|
{
|
||||||
$fileName = App::getBasedir() .
|
$fileName = App::getBasedir() .
|
||||||
'../logs/' .
|
'logs/' .
|
||||||
$logName . '.log';
|
$logName . '.log';
|
||||||
|
|
||||||
return file_put_contents(
|
return file_put_contents(
|
||||||
|
|
@ -32,8 +32,7 @@ class Image
|
||||||
public static function createAllSizes($imgName, $noWatermark = false, $folder = '')
|
public static function createAllSizes($imgName, $noWatermark = false, $folder = '')
|
||||||
{
|
{
|
||||||
$sizes = App::getConfig('images');
|
$sizes = App::getConfig('images');
|
||||||
$pathInfo = pathinfo($_SERVER['SCRIPT_FILENAME']);
|
$uploaddir = App::getBasedir() . 'public/photos/' . $folder;
|
||||||
$uploaddir = $pathInfo['dirname'] . '/photos/' . $folder;
|
|
||||||
$watermarkDir = App::getBasedir() . 'watermarks/';
|
$watermarkDir = App::getBasedir() . 'watermarks/';
|
||||||
|
|
||||||
foreach ($sizes as $dir => $size) {
|
foreach ($sizes as $dir => $size) {
|
||||||
|
|
@ -32,13 +32,13 @@ class ImagesController extends Controller
|
||||||
|
|
||||||
|
|
||||||
if ($img) {
|
if ($img) {
|
||||||
$photo = $photo = App::getBasedir() . '../public/' . 'photos/' . $img->name;
|
$photo = $photo = App::getBasedir() . 'public/' . 'photos/' . $img->name;
|
||||||
} else {
|
} else {
|
||||||
$photo = $photo = App::getBasedir() . '../public/' . 'img/noPhoto.png';
|
$photo = $photo = App::getBasedir() . 'public/' . 'img/noPhoto.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file_exists($photo)) {
|
if (!file_exists($photo)) {
|
||||||
$photo = $photo = App::getBasedir() . '../public/' . 'img/noPhoto.png';
|
$photo = $photo = App::getBasedir() . 'public/' . 'img/noPhoto.png';
|
||||||
}
|
}
|
||||||
|
|
||||||
Image::createCustomSize($photo, $width, $height);
|
Image::createCustomSize($photo, $width, $height);
|
||||||
|
|
@ -49,7 +49,7 @@ class ImagesController extends Controller
|
||||||
{
|
{
|
||||||
if (isset($_FILES) && !empty($_FILES) && App::$user) {
|
if (isset($_FILES) && !empty($_FILES) && App::$user) {
|
||||||
$userId = App::$user->id;
|
$userId = App::$user->id;
|
||||||
$uploaddir = App::getBasedir() . '../public/photos/articles/';
|
$uploaddir = App::getBasedir() . 'public/photos/articles/';
|
||||||
$fileName = (string)$_FILES['photo']['name'];
|
$fileName = (string)$_FILES['photo']['name'];
|
||||||
$temp = pathinfo($fileName);
|
$temp = pathinfo($fileName);
|
||||||
$extension = strtolower($temp['extension']);
|
$extension = strtolower($temp['extension']);
|
||||||
|
|
@ -135,7 +135,7 @@ class IndexController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$target = App::getBasedir().'../public/img/avatars/'.$user->id.'.jpg';
|
$target = App::getBasedir().'public/img/avatars/'.$user->id.'.jpg';
|
||||||
Image::createAvatar($uLoginUser['photo_big'], $target);
|
Image::createAvatar($uLoginUser['photo_big'], $target);
|
||||||
|
|
||||||
App::userLogin($user);
|
App::userLogin($user);
|
||||||
|
|
@ -139,7 +139,7 @@ class JsonController extends Controller
|
||||||
$photos = $images = array();
|
$photos = $images = array();
|
||||||
if (empty($errors) && !App::$request['ajax'] && isset($_POST['id']) && (int) $_POST['id']) {
|
if (empty($errors) && !App::$request['ajax'] && isset($_POST['id']) && (int) $_POST['id']) {
|
||||||
$id = (int) $_POST['id'];
|
$id = (int) $_POST['id'];
|
||||||
$uploaddir = App::getBasedir().'../public/photos/';
|
$uploaddir = App::getBasedir().'public/photos/';
|
||||||
|
|
||||||
if (isset($_FILES) && !empty($_FILES)) {
|
if (isset($_FILES) && !empty($_FILES)) {
|
||||||
foreach ($_FILES['photos']['name'] as $key => $fileName) {
|
foreach ($_FILES['photos']['name'] as $key => $fileName) {
|
||||||
|
|
@ -7,5 +7,5 @@
|
||||||
ini_set('session.gc_maxlifetime', 86400);
|
ini_set('session.gc_maxlifetime', 86400);
|
||||||
ini_set('session.cookie_lifetime', 86400);
|
ini_set('session.cookie_lifetime', 86400);
|
||||||
|
|
||||||
include_once dirname(__FILE__) . '/../ground/app.php';
|
include_once dirname(__FILE__) . '/../app.php';
|
||||||
App::run('config.php');
|
App::run('config.php');
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
git pull
|
git pull
|
||||||
git rev-parse HEAD | cut -c-5 > ground/version
|
git rev-parse HEAD | cut -c-5 > version
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Loading…
Reference in New Issue