Skip to content

Commit

Permalink
init basic structure
Browse files Browse the repository at this point in the history
  • Loading branch information
wachterjohannes committed Jun 14, 2016
1 parent 135d831 commit bfeaebd
Show file tree
Hide file tree
Showing 64 changed files with 8,080 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# app
/app/bootstrap.php.cache
/app/config/parameters.yml
app/maintenance.php

# bin
/bin/*
!/bin/console
!/bin/console.php
!/bin/websiteconsole
!/bin/adminconsole
!/bin/symfony_requirements

# var
/var/cache/*
/var/indexes/*
/var/logs/*
/var/sessions/*
/var/uploads/*
!/var/cache/.gitkeep
!/var/indexes/.gitkeep
!/var/logs/.gitkeep
!/var/sessions/.gitkeep
!/var/uploads/.gitkeep

# web
/web/css
/web/js
/web/bundles
/web/uploads
/web/bootstrap.php.cache
/web/SymfonyRequirements.php

# composer
/composer.phar
/vendor

# IDEs
/.idea
*.iml
*~

# System files
.DS_Store
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,15 @@

Welcome to the Sulu Minimal Edition - a fully-functional Sulu application that you can use as the skeleton for your new
applications.

## Installation

__Mac:__

```
rm -rf var/cache/*
rm -rf var/logs/*
HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
sudo chmod +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" var/cache var/logs var/uploads var/uploads/* web/uploads web/uploads/* var/indexes
sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" var/cache var/logs var/uploads var/uploads/* web/uploads web/uploads/* var/indexes
```
140 changes: 140 additions & 0 deletions app/AbstractKernel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<?php

/*
* This file is part of Sulu.
*
* (c) MASSIVE ART WebServices GmbH
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

use Sulu\Component\HttpKernel\SuluKernel;
use Symfony\Component\Config\Loader\LoaderInterface;

/**
* The abstract kernel holds everything that is common between
* AdminKernel and WebsiteKernel.
*/
abstract class AbstractKernel extends SuluKernel
{
/**
* {@inheritdoc}
*/
public function registerBundles()
{
$bundles = [
// symfony standard
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new Sulu\Bundle\CoreBundle\SuluCoreBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(),

// symfony cmf
new Symfony\Cmf\Bundle\CoreBundle\CmfCoreBundle(),

// doctrine extensions
new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),
new Doctrine\Bundle\PHPCRBundle\DoctrinePHPCRBundle(),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),

// rest
new FOS\RestBundle\FOSRestBundle(),
new JMS\SerializerBundle\JMSSerializerBundle(),
new Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(),

// massive
new Massive\Bundle\SearchBundle\MassiveSearchBundle(),

// sulu
new Sulu\Bundle\SearchBundle\SuluSearchBundle(),
new Sulu\Bundle\PersistenceBundle\SuluPersistenceBundle(),
new Sulu\Bundle\ContactBundle\SuluContactBundle(),
new Sulu\Bundle\MediaBundle\SuluMediaBundle(),
new Sulu\Bundle\SecurityBundle\SuluSecurityBundle(),
new Sulu\Bundle\CategoryBundle\SuluCategoryBundle(),
new Sulu\Bundle\SnippetBundle\SuluSnippetBundle(),
new Sulu\Bundle\ContentBundle\SuluContentBundle(),
new Sulu\Bundle\TagBundle\SuluTagBundle(),
new Sulu\Bundle\WebsiteBundle\SuluWebsiteBundle(),
new Sulu\Bundle\LocationBundle\SuluLocationBundle(),
new Sulu\Bundle\HttpCacheBundle\SuluHttpCacheBundle(),
new Sulu\Bundle\WebsocketBundle\SuluWebsocketBundle(),
new Sulu\Bundle\TranslateBundle\SuluTranslateBundle(),
new Sulu\Bundle\DocumentManagerBundle\SuluDocumentManagerBundle(),
new Sulu\Bundle\HashBundle\SuluHashBundle(),
new Sulu\Bundle\CustomUrlBundle\SuluCustomUrlBundle(),
new Sulu\Bundle\RouteBundle\SuluRouteBundle(),
new Sulu\Bundle\MarkupBundle\SuluMarkupBundle(),
new DTL\Bundle\PhpcrMigrations\PhpcrMigrationsBundle(),
new Dubture\FFmpegBundle\DubtureFFmpegBundle(),

// tools
new Massive\Bundle\BuildBundle\MassiveBuildBundle(),
];

if (in_array($this->getEnvironment(), ['dev', 'test'])) {
// symfony standard
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();

// debug enhancement
$bundles[] = new Sulu\Bundle\TestBundle\SuluTestBundle();
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
}

return $bundles;
}

/**
* {@inheritdoc}
*/
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(
$this->rootDir . DIRECTORY_SEPARATOR
. 'config' . DIRECTORY_SEPARATOR
. $this->getContext() . DIRECTORY_SEPARATOR
. 'config_' . $this->getEnvironment() . '.yml'
);
}

/**
* {@inheritdoc}
*/
public function getCacheDir()
{
return dirname($this->rootDir) . DIRECTORY_SEPARATOR
. 'var' . DIRECTORY_SEPARATOR
. 'cache' . DIRECTORY_SEPARATOR
. $this->getContext() . DIRECTORY_SEPARATOR
. $this->environment;
}

/**
* {@inheritdoc}
*/
public function getLogDir()
{
return dirname($this->rootDir) . DIRECTORY_SEPARATOR
. 'var' . DIRECTORY_SEPARATOR
. 'logs' . DIRECTORY_SEPARATOR
. $this->getContext() . DIRECTORY_SEPARATOR
. $this->environment;
}

protected function getKernelParameters()
{
return array_merge(
parent::getKernelParameters(),
[
'kernel.var_dir' => dirname($this->rootDir) . DIRECTORY_SEPARATOR . 'var'
]
);
}
}
49 changes: 49 additions & 0 deletions app/AdminKernel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

/*
* This file is part of Sulu.
*
* (c) MASSIVE ART WebServices GmbH
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

/**
* The admin kernel is for the backend.
*/
class AdminKernel extends AbstractKernel
{
/**
* {@inheritdoc}
*/
protected $name = 'admin';

/**
* @param string $environment
* @param bool $debug
*/
public function __construct($environment, $debug)
{
parent::__construct($environment, $debug);
$this->setContext(self::CONTEXT_ADMIN);
}

/**
* {@inheritdoc}
*/
public function registerBundles()
{
$bundles = parent::registerBundles();
$bundles[] = new Symfony\Bundle\SecurityBundle\SecurityBundle();
$bundles[] = new Sulu\Bundle\AdminBundle\SuluAdminBundle();
$bundles[] = new Sulu\Bundle\CollaborationBundle\SuluCollaborationBundle();
$bundles[] = new Sulu\Bundle\PreviewBundle\SuluPreviewBundle();

if (in_array($this->getEnvironment(), ['dev', 'test'])) {
$bundles[] = new Sulu\Bundle\GeneratorBundle\SuluGeneratorBundle();
}

return $bundles;
}
}
50 changes: 50 additions & 0 deletions app/Resources/templates/pages/default.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" ?>
<template xmlns="http://schemas.sulu.io/template/template"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.sulu.io/template/template http://schemas.sulu.io/template/template-1.0.xsd">

<key>default</key>

<view>templates/default</view>
<controller>SuluWebsiteBundle:Default:index</controller>
<cacheLifetime>2400</cacheLifetime>

<meta>
<title lang="en">Default</title>
<title lang="de">Standard</title>
</meta>

<properties>
<section name="highlight">
<properties>
<property name="title" type="text_line" mandatory="true">
<meta>
<title lang="en">Title</title>
<title lang="de">Titel</title>
</meta>
<params>
<param name="headline" value="true"/>
</params>

<tag name="sulu.rlp.part"/>
</property>

<property name="url" type="resource_locator" mandatory="true">
<meta>
<title lang="en">Resourcelocator</title>
<title lang="de">Adresse</title>
</meta>

<tag name="sulu.rlp"/>
</property>
</properties>
</section>

<property name="article" type="text_editor">
<meta>
<title lang="en">Article</title>
<title lang="de">Artikel</title>
</meta>
</property>
</properties>
</template>
50 changes: 50 additions & 0 deletions app/Resources/templates/pages/homepage.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" ?>
<template xmlns="http://schemas.sulu.io/template/template"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.sulu.io/template/template http://schemas.sulu.io/template/template-1.0.xsd">

<key>default</key>

<view>templates/homepage</view>
<controller>SuluWebsiteBundle:Default:index</controller>
<cacheLifetime>2400</cacheLifetime>

<meta>
<title lang="en">Default</title>
<title lang="de">Standard</title>
</meta>

<properties>
<section name="highlight">
<properties>
<property name="title" type="text_line" mandatory="true">
<meta>
<title lang="en">Title</title>
<title lang="de">Titel</title>
</meta>
<params>
<param name="headline" value="true"/>
</params>

<tag name="sulu.rlp.part"/>
</property>

<property name="url" type="resource_locator" mandatory="true">
<meta>
<title lang="en">Resourcelocator</title>
<title lang="de">Adresse</title>
</meta>

<tag name="sulu.rlp"/>
</property>
</properties>
</section>

<property name="article" type="text_editor">
<meta>
<title lang="en">Article</title>
<title lang="de">Artikel</title>
</meta>
</property>
</properties>
</template>
30 changes: 30 additions & 0 deletions app/Resources/templates/snippets/default.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" ?>
<template xmlns="http://schemas.sulu.io/template/template"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.sulu.io/template/template http://schemas.sulu.io/template/template-1.0.xsd">

<key>default</key>

<meta>
<title lang="en">Default</title>
<title lang="de">Standard</title>
</meta>

<properties>
<property name="title" type="text_line" mandatory="true">
<meta>
<title lang="en">Title</title>
<title lang="de">Titel</title>
</meta>

<tag name="sulu.node.name"/>
</property>

<property name="description" type="text_editor">
<meta>
<title lang="en">Description</title>
<title lang="de">Beschreibung</title>
</meta>
</property>
</properties>
</template>
7 changes: 7 additions & 0 deletions app/Resources/views/error/404.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends "master.html.twig" %}

{% block content %}
<h1>Resource not found</h1>

<p>The path "<em>{{ request.resourceLocator }}</em>" does not exist.</p>
{% endblock %}
Loading

0 comments on commit bfeaebd

Please sign in to comment.