Skip to content

Commit

Permalink
base work
Browse files Browse the repository at this point in the history
  • Loading branch information
vasiliishvakin committed Apr 17, 2017
1 parent bdc056f commit 8ff7252
Show file tree
Hide file tree
Showing 21 changed files with 447 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -8,4 +8,4 @@ tests/_output/*

composer.lock

tests/_output/*
tests/_output/*
7 changes: 5 additions & 2 deletions composer.json
Expand Up @@ -15,16 +15,19 @@
"Sites\\All\\": "src"
}
},
"provide": {
"akademiano/site-all-implementation": "1.0.0"
},
"require": {
"akademiano/application": "^1.0.0-beta.2"
"akademiano/core": "^1.0.0-beta.4"
},
"require-dev": {
"codeception/codeception": "^2.2.10",
"codeception/c3": "^2.0.10",
"satooshi/php-coveralls": "^1.0",
"mockery/mockery": "^0.9.9"
},
"config": {
"config": {
"fxp-asset": {
"installer-paths": {
"npm-asset-library": "public/assets/vendor",
Expand Down
67 changes: 67 additions & 0 deletions public/index.php
@@ -0,0 +1,67 @@
<?php

if (!defined("ROOT_DIR")) {
define('ROOT_DIR', realpath(__DIR__ . '/..'));
}
if (!defined("PUBLIC_DIR")) {
define('PUBLIC_DIR', ROOT_DIR . '/public');
}
if (!defined("VENDOR_DIR")) {
define('VENDOR_DIR', ROOT_DIR . '/vendor');
}
if (!defined("DATA_DIR")) {
define('DATA_DIR', ROOT_DIR . '/data');
}

if (!is_dir(__DIR__ . "/../vendor")) {
die("Access Denied: index script not inside root public dir");
}

$loader = require ROOT_DIR . "/vendor/autoload.php";

$app = new \Akademiano\Core\Application();
$app->setLoader($loader);

$app->getDiContainer()->extend('baseConfigLoader', function (\Akademiano\Config\ConfigLoader $configLoader, \Pimple\Container $pimple) {
$configLoader->addConfigDir(ROOT_DIR . "/src/config");
return $configLoader;
});

/*$app->getDiContainer()["baseConfig"] = new \Akademiano\Config\Config(
[
'view' => [
'adapter' => 'twig',
'options' => [
'cache' => false,
"debug" => true,
],
"init" => [
"setLocale" => function ($c) {
setlocale(LC_ALL, 'ru_RU.UTF-8');
setlocale(LC_NUMERIC, "en_US.UTF-8");
locale_set_default('ru');
}
],
"Acl" => [
"adapter" => "Akademiano\\Acl\\Model\\Adapter\\RegisteredAdapter",
],
"modules" => [
"Akademiano\\Core",
],
],
]
);
*/


/*$app->getDiContainer()["routes"] = [
"root" => [
"patterns" => [
"type" => \Akademiano\Router\RoutePattern::TYPE_FIRST_PREFIX,
"value" => "/",
],
"action" => ["index", "index"],
],
];*/

$app->run();
14 changes: 14 additions & 0 deletions src/Controller/IndexController.php
@@ -0,0 +1,14 @@
<?php
namespace Sites\All\Controller;


use Akademiano\Core\Controller\AbstractController;

class IndexController extends AbstractController
{
public function indexAction()
{
echo "OK";
$this->autoRenderOff();
}
}
10 changes: 10 additions & 0 deletions src/Site.php
@@ -0,0 +1,10 @@
<?php


namespace Sites\All;


class Site
{

}
66 changes: 66 additions & 0 deletions src/config/config.php
@@ -0,0 +1,66 @@
<?php
return [
'view' => [
'adapter' => 'twig',
'options' => [
'cache' => true,
"debug" => false,
],
"extensions" => [
"Twig_Extension_Debug",
"Akademiano\\Twig\\Extensions\\AssetExtension",
"Akademiano\\Twig\\Extensions\\UrlExtension",
"Akademiano\\User\\Twig\\UserExtension",
],
"filters" => [
"cropBySpace" => [["\\Aademiano\\Utils\\StringUtils", "cropBySpace"], ['pre_escape' => 'html']],
"urlToTag" => [
["\\Aademiano\\Utils\\StringUtils", "urlToTag"],
['pre_escape' => 'html', 'is_safe' => array('html')]
],
"nl2p" => [["\\Aademiano\\Utils\\StringUtils", "nl2p"], ['pre_escape' => 'html', 'is_safe' => array('html')]],
"cutStr" => [["\\Aademiano\\Utils\\StringUtils", "cutStr"], ['pre_escape' => 'html', 'is_safe' => array('html')]],
"nl2Array" => [["\\Aademiano\\Utils\\StringUtils", "nl2Array"], []],
"dechex" => [function($id) {
if($id instanceof \Akademiano\Entity\UuidInterface) {
$id = (string) $id->getHex();
return$id;
} elseif (is_numeric($id)) {
return dechex((int)$id);
} else {
throw new RuntimeException("Culd not convert to hex not numeric or uuid item");
}
}, []],
"dateIntl" => [["\\Aademiano\\Utils\\Time", "toStrIntl"], []],
"date2Month" => [["\\Aademiano\\Utils\\Time", "calendarMonth"], ['is_safe' => array('html')]],
],
"urlExtension" => [
"routeGenerator" => [
\Akademiano\Config\Config::DYN_CONF => function ($c) {
$router = $c["router"];
return [$router, "getUrl"];
}
]
],
"userExtension" => [
"custodian" => [
\Akademiano\Config\Config::DYN_CONF => function ($c) {
return $c["custodian"];
}
]
]
],
"init" => [
"setLocale" => function ($c) {
setlocale(LC_ALL, 'ru_RU.UTF-8');
setlocale(LC_NUMERIC, "en_US.UTF-8");
locale_set_default('ru');
}
],
"Acl" => [
"adapter" => "Akademiano\\Acl\\Model\\Adapter\\RegisteredAdapter",
],
"modules" => [
"Akademiano\\User"
],
];
5 changes: 5 additions & 0 deletions src/config/local.config.dist.php
@@ -0,0 +1,5 @@
<?php

return [

];
11 changes: 11 additions & 0 deletions src/config/routes.php
@@ -0,0 +1,11 @@
<?php

return [
"root" => [
"patterns" => [
"type" =>\Akademiano\Router\RoutePattern::TYPE_FIRST_PREFIX,
"value" => "/",
],
"action" => ["index", "index"],
],
];
5 changes: 5 additions & 0 deletions src/themes/default/admin/index.twig
@@ -0,0 +1,5 @@
{% extends "layoutAdmin.twig" %}

{% block article %}

{% endblock %}
44 changes: 44 additions & 0 deletions src/themes/default/assets/css/delta-index.css
@@ -0,0 +1,44 @@
body {
padding-top: 20px;
padding-bottom: 40px;
}

/* Custom container */
.container-narrow {
margin: 0 auto;
max-width: 700px;
}
.container-narrow > hr {
margin: 30px 0;
}

/* Main marketing message and sign up button */
.jumbotron {
margin: 60px 0;
text-align: center;
background-color: #ffffff;
}
.jumbotron h1 {
font-size: 72px;
line-height: 1;
}
.jumbotron .btn {
font-size: 21px;
padding: 14px 24px;
}

/* Supporting marketing content */
.marketing {
margin: 60px 0;
}
.marketing p + h4 {
margin-top: 28px;
}

div.liDesc>p {
height: 60px;
}

div.docs h4 {
font-size: 12px;
}
16 changes: 16 additions & 0 deletions src/themes/default/assets/js/colorbox.init.js
@@ -0,0 +1,16 @@
$(document).ready(function () {
$(".photo-thumb").colorbox({
rel: 'photo-thumb',
slideshow: true,
slideshowSpeed: 4000,
slideshowAuto: false,
// transition:"none",
speed: 400,
maxWidth: "100%", maxHeight: "100%",
"isFitWidth": true,

current: "{current} из {total}",
slideshowStart: "начать слайдшоу",
slideshowStop: "остановить слайдшоу"
});
});
9 changes: 9 additions & 0 deletions src/themes/default/colorbox.twig
@@ -0,0 +1,9 @@
{{ asset_css_once([
"colorbox/example1/colorbox.css"
], default, true) }}

{{ asset_js_once([
"colorbox/jquery.colorbox-min.js",
"colorbox/i18n/jquery.colorbox-ru.js",
"assets/js/colorbox.init.js",
], default, true) }}
23 changes: 23 additions & 0 deletions src/themes/default/index/index.twig
@@ -0,0 +1,23 @@
{% extends "layout.twig" %}

{% block head %}
{{ parent() }}

<link href="/static/css/delta.css" rel="stylesheet">

{% endblock head %}

{% block content %}
<div class="container-narrow">
<div class="jumbotron">
<h1>
Akademiano Default All Site Template
</h1>

<p class="lead">
Default start page of Akademiano framework.
</p>
<a class="btn btn-large btn-success" href="https://github.com/mrdatamapper/akademiano-application">Github</a>
</div>
</div>
{% endblock content %}
72 changes: 72 additions & 0 deletions src/themes/default/layout.twig
@@ -0,0 +1,72 @@
<!DOCTYPE html>
<html lang={{ html.lang|default("ru") }}>
<head>
{% block head %}
<title>{{ pageTitle | default('DeltaPHP Demo Site') }}</title>
<meta name="description"
content="{{ pageDescription | default('Simple and fast PHP 5.4+ MVC framework with a modular organization') }}"/>
<meta charset="utf-8">
<base href="/">
{% if canonicalRef %}
<link rel="canonical" href="{{ canonicalRef }}"/>
{% endif %}
<meta name="viewport" content="width=device-width, initial-scale=1.0">

{{ asset_css([
"bootstrap/dist/css/bootstrap.css",
"bootstrap/dist/css/bootstrap-theme.css",
], default, true) }}

{#
<!--[if lt IE 9]>
{{ asset_js(["html5shiv/dist/html5shiv.min.js", "respond/dest/respond.min.js"], default, true) }}
<![endif]-->#}
{{ asset_js([
"jquery/dist/jquery.min.js",
"bootstrap/dist/js/bootstrap.min.js"
], default, true) }}
{% endblock head %}
</head>
<body>

{% block body %}
<div class="container">
{% block content %}
<div class="row">
<aside class="col-md-3">
{% block aside %}

{% endblock aside %}
</aside>
<article class="col-md-9">
{% block article %}

{% endblock article %}
</article>
</div>
{% endblock content %}
</div>


<footer>
<div class="container">
<div class="row">
<div class="col-md-12 footer">
{% block footer %}
<p>© <a href="http://deltaphp.org">DeltaPHP</a> 2014</p>
{% endblock footer %}
</div>
</div>
</div>
</footer>

{% if includeAnalitics %}
{% block counters %}
{% include "analitics.twig" %}
{% endblock counters %}
{% endif %}

{% endblock body %}

</body>
</html>

0 comments on commit 8ff7252

Please sign in to comment.