Commit c751b014 authored by David Narvaez's avatar David Narvaez

Initial commit of the project

Currently just shows the workflow of the tool and basic loading of
images from a commons category
parents
<?xml version="1.0" encoding="UTF-8"?>
<buildpath>
<buildpathentry kind="src" path="vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs"/>
<buildpathentry kind="src" path="vendor/sensio/distribution-bundle"/>
<buildpathentry kind="src" path="vendor/twig/extensions/lib"/>
<buildpathentry kind="src" path="vendor/symfony/monolog-bundle"/>
<buildpathentry kind="src" path="vendor/jms/metadata/src"/>
<buildpathentry kind="src" path="vendor/swiftmailer/swiftmailer/lib"/>
<buildpathentry kind="src" path="vendor/sensio/generator-bundle"/>
<buildpathentry kind="src" path="vendor/doctrine/inflector/lib"/>
<buildpathentry kind="src" path="vendor/jms/di-extra-bundle"/>
<buildpathentry kind="src" path="vendor/jms/security-extra-bundle"/>
<buildpathentry kind="src" path="vendor/composer"/>
<buildpathentry kind="src" path="vendor/doctrine/orm/lib"/>
<buildpathentry kind="src" path="vendor/doctrine/annotations/lib"/>
<buildpathentry kind="src" path="src"/>
<buildpathentry kind="src" path="vendor/jms/cg/src"/>
<buildpathentry kind="src" path="vendor/doctrine/doctrine-bundle"/>
<buildpathentry kind="src" path="vendor/monolog/monolog/src"/>
<buildpathentry kind="src" path="vendor/doctrine/common/lib"/>
<buildpathentry kind="src" path="vendor/jms/parser-lib/src"/>
<buildpathentry excluding="Symfony/Component/HttpFoundation/Resources/stubs/|Symfony/Component/Locale/Resources/stubs/" kind="src" path="vendor/symfony/symfony/src"/>
<buildpathentry kind="src" path="vendor/friendsofsymfony/user-bundle"/>
<buildpathentry kind="src" path="vendor/doctrine/cache/lib"/>
<buildpathentry kind="src" path="vendor/doctrine/dbal/lib"/>
<buildpathentry kind="src" path="vendor/symfony/swiftmailer-bundle"/>
<buildpathentry kind="src" path="vendor/kriswallsmith/assetic/src"/>
<buildpathentry kind="src" path="vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Resources/stubs"/>
<buildpathentry kind="src" path="vendor/sensio/framework-extra-bundle"/>
<buildpathentry kind="src" path="vendor/jms/aop-bundle"/>
<buildpathentry kind="src" path="vendor/doctrine/collections/lib"/>
<buildpathentry kind="src" path="vendor/psr/log"/>
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
<buildpathentry kind="src" path="vendor/twig/twig/lib"/>
<buildpathentry kind="src" path="vendor/doctrine/lexer/lib"/>
<buildpathentry kind="src" path="vendor/jdorn/sql-formatter/lib"/>
<buildpathentry kind="src" path="vendor/phpoption/phpoption/src"/>
<buildpathentry kind="src" path="vendor/symfony/assetic-bundle"/>
</buildpath>
/web/bundles/
/app/bootstrap.php.cache
/app/cache/*
/app/logs/*
/build/
/vendor/
/bin/
/composer.phar
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>WLMJuryTool</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.dubture.doctrine.core.doctrineBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.dubture.symfony.core.symfonyBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.dubture.composer.core.builder.buildPathManagementBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.dltk.core.scriptbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.php.core.PHPNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>com.dubture.composer.core.composerNature</nature>
<nature>com.dubture.symfony.core.symfonyNature</nature>
<nature>com.dubture.doctrine.core.doctrineNature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
phpVersion=php5.3
use_asp_tags_as_php=false
eclipse.preferences.version=1
org.eclipse.php.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates/>
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="php.core.component" version="1"/>
<installed facet="php.component" version="5.3"/>
<installed facet="php.composer.component" version="1"/>
<installed facet="php.symfony.component" version="2.2"/>
</faceted-project>
eclipse.preferences.version=1
org.pdtextensions.semanticanalysisfixer_phar=/home/david/Projects/php-cs-fixer.phar
org.pdtextensions.semanticanalysisphp_executable=/usr/lib/php5.4/bin/php
org.pdtextensions.semanticanalysisuse_project_phar=false
phpcs_use_default_fixers=yes
language: php
php:
- 5.3.3
- 5.3
- 5.4
before_script: composer install
script: phpunit -c app
Copyright (c) 2004-2013 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Symfony Standard Edition
========================
Welcome to the Symfony Standard Edition - a fully-functional Symfony2
application that you can use as the skeleton for your new applications.
This document contains information on how to download, install, and start
using Symfony. For a more detailed explanation, see the [Installation][1]
chapter of the Symfony Documentation.
1) Installing the Standard Edition
----------------------------------
When it comes to installing the Symfony Standard Edition, you have the
following options.
### Use Composer (*recommended*)
As Symfony uses [Composer][2] to manage its dependencies, the recommended way
to create a new project is to use it.
If you don't have Composer yet, download it following the instructions on
http://getcomposer.org/ or just run the following command:
curl -s http://getcomposer.org/installer | php
Then, use the `create-project` command to generate a new Symfony application:
php composer.phar create-project symfony/framework-standard-edition path/to/install
Composer will install Symfony and all its dependencies under the
`path/to/install` directory.
### Download an Archive File
To quickly test Symfony, you can also download an [archive][3] of the Standard
Edition and unpack it somewhere under your web server root directory.
If you downloaded an archive "without vendors", you also need to install all
the necessary dependencies. Download composer (see above) and run the
following command:
php composer.phar install
2) Checking your System Configuration
-------------------------------------
Before starting coding, make sure that your local system is properly
configured for Symfony.
Execute the `check.php` script from the command line:
php app/check.php
Access the `config.php` script from a browser:
http://localhost/path/to/symfony/app/web/config.php
If you get any warnings or recommendations, fix them before moving on.
3) Browsing the Demo Application
--------------------------------
Congratulations! You're now ready to use Symfony.
From the `config.php` page, click the "Bypass configuration and go to the
Welcome page" link to load up your first Symfony page.
You can also use a web-based configurator by clicking on the "Configure your
Symfony Application online" link of the `config.php` page.
To see a real-live Symfony page in action, access the following page:
web/app_dev.php/demo/hello/Fabien
4) Getting started with Symfony
-------------------------------
This distribution is meant to be the starting point for your Symfony
applications, but it also contains some sample code that you can learn from
and play with.
A great way to start learning Symfony is via the [Quick Tour][4], which will
take you through all the basic features of Symfony2.
Once you're feeling good, you can move onto reading the official
[Symfony2 book][5].
A default bundle, `AcmeDemoBundle`, shows you Symfony2 in action. After
playing with it, you can remove it by following these steps:
* delete the `src/Acme` directory;
* remove the routing entries referencing AcmeBundle in
`app/config/routing_dev.yml`;
* remove the AcmeBundle from the registered bundles in `app/AppKernel.php`;
* remove the `web/bundles/acmedemo` directory;
* remove the `security.providers`, `security.firewalls.login` and
`security.firewalls.secured_area` entries in the `security.yml` file or
tweak the security configuration to fit your needs.
What's inside?
---------------
The Symfony Standard Edition is configured with the following defaults:
* Twig is the only configured template engine;
* Doctrine ORM/DBAL is configured;
* Swiftmailer is configured;
* Annotations for everything are enabled.
It comes pre-configured with the following bundles:
* **FrameworkBundle** - The core Symfony framework bundle
* [**SensioFrameworkExtraBundle**][6] - Adds several enhancements, including
template and routing annotation capability
* [**DoctrineBundle**][7] - Adds support for the Doctrine ORM
* [**TwigBundle**][8] - Adds support for the Twig templating engine
* [**SecurityBundle**][9] - Adds security by integrating Symfony's security
component
* [**SwiftmailerBundle**][10] - Adds support for Swiftmailer, a library for
sending emails
* [**MonologBundle**][11] - Adds support for Monolog, a logging library
* [**AsseticBundle**][12] - Adds support for Assetic, an asset processing
library
* [**JMSSecurityExtraBundle**][13] - Allows security to be added via
annotations
* [**JMSDiExtraBundle**][14] - Adds more powerful dependency injection
features
* **WebProfilerBundle** (in dev/test env) - Adds profiling functionality and
the web debug toolbar
* **SensioDistributionBundle** (in dev/test env) - Adds functionality for
configuring and working with Symfony distributions
* [**SensioGeneratorBundle**][15] (in dev/test env) - Adds code generation
capabilities
* **AcmeDemoBundle** (in dev/test env) - A demo bundle with some example
code
Enjoy!
[1]: http://symfony.com/doc/2.2/book/installation.html
[2]: http://getcomposer.org/
[3]: http://symfony.com/download
[4]: http://symfony.com/doc/2.2/quick_tour/the_big_picture.html
[5]: http://symfony.com/doc/2.2/index.html
[6]: http://symfony.com/doc/2.2/bundles/SensioFrameworkExtraBundle/index.html
[7]: http://symfony.com/doc/2.2/book/doctrine.html
[8]: http://symfony.com/doc/2.2/book/templating.html
[9]: http://symfony.com/doc/2.2/book/security.html
[10]: http://symfony.com/doc/2.2/cookbook/email.html
[11]: http://symfony.com/doc/2.2/cookbook/logging/monolog.html
[12]: http://symfony.com/doc/2.2/cookbook/assetic/asset_management.html
[13]: http://jmsyst.com/bundles/JMSSecurityExtraBundle/master
[14]: http://jmsyst.com/bundles/JMSDiExtraBundle/master
[15]: http://symfony.com/doc/2.2/bundles/SensioGeneratorBundle/index.html
UPGRADE FROM 2.1 to 2.2
=======================
* The [`web/.htaccess`](https://github.com/symfony/symfony-standard/blob/2.2/web/.htaccess)
file has been enhanced substantially to prevent duplicate content with and
without `/app.php` in the URI. It also improves functionality when using
Apache aliases or when mod_rewrite is not available. So you might want to
update your `.htaccess` file as well.
* The ``_internal`` route is not used any more. It should then be removed
from both your routing and security configurations. A ``fragments`` key has
been added to the framework configuration and must be specified when ESI or
Hinclude are in use. No security configuration is required for this path as
by default ESI access is only permitted for trusted hosts and Hinclude
access uses an URL signing mechanism.
```
framework:
# ...
fragments: { path: /_proxy }
```
Functional Tests
----------------
* The profiler has been disabled by default in the test environment. You can
enable it again by modifying the ``config_test.yml`` configuration file or
even better, you can just enable it for the very next request by calling
``$client->enableProfiler()`` when you need the profiler in a test (that
speeds up functional tests quite a bit).
Symfony Standard Edition Upgrade
================================
From Symfony 2.0 to Symfony 2.1
-------------------------------
### Project Dependencies
As of Symfony 2.1, project dependencies are managed by
[Composer](http://getcomposer.org/):
* The `bin/vendors` script can be removed as `composer.phar` does all the work
now (it is recommended to install it globally on your machine).
* The `deps` file need to be replaced with the `composer.json` one.
* The `composer.lock` is the equivalent of the generated `deps.lock` file and
it is automatically generated by Composer.
Download the default
[`composer.json`](https://raw.github.com/symfony/symfony-standard/2.1/composer.json)
and
[`composer.lock`](https://raw.github.com/symfony/symfony-standard/2.1/composer.lock)
files for Symfony 2.1 and put them into the main directory of your project. If
you have customized your `deps` file, move the added dependencies to the
`composer.json` file (many bundles and PHP libraries are already available as
Composer packages -- search for them on [Packagist](http://packagist.org/)).
Remove your current `vendor` directory.
Finally, run Composer:
$ composer.phar install
Note: You must complete the upgrade steps below so composer can successfully generate the autoload files.
### `app/autoload.php`
The default `autoload.php` reads as follows (it has been simplified a lot as
autoloading for libraries and bundles declared in your `composer.json` file is
automatically managed by the Composer autoloader):
<?php
use Doctrine\Common\Annotations\AnnotationRegistry;
$loader = include __DIR__.'/../vendor/autoload.php';
// intl
if (!function_exists('intl_get_error_code')) {
require_once __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
$loader->add('', __DIR__.'/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs');
}
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
return $loader;
### `app/config/config.yml`
The `framework.charset` setting must be removed. If you are not using `UTF-8`
for your application, override the `getCharset()` method in your `AppKernel`
class instead:
class AppKernel extends Kernel
{
public function getCharset()
{
return 'ISO-8859-1';
}
// ...
}
You might want to add the new `strict_requirements` parameter to
`framework.router` (it avoids fatal errors in the production environment when
a link cannot be generated):
framework:
router:
strict_requirements: %kernel.debug%
You can even disable the requirements check on production with `null` as you should
know that the parameters for URL generation always pass the requirements, e.g. by
validating them beforehand. This additionally enhances performance. See
[config_prod.yml](https://github.com/symfony/symfony-standard/blob/master/app/config/config_prod.yml).
The `default_locale` parameter is now a setting of the main `framework`
configuration (it was under the `framework.session` in 2.0):
framework:
default_locale: %locale%
The `auto_start` setting under `framework.session` must be removed as it is
not used anymore (the session is now always started on-demand). If
`auto_start` was the only setting under the `framework.session` entry, don't
remove it entirely, but set its value to `~` (`~` means `null` in YAML)
instead:
framework:
session: ~
The `trust_proxy_headers` setting was added in the default configuration file
(as it should be set to `true` when you install your application behind a
reverse proxy):
framework:
trust_proxy_headers: false
An empty `bundles` entry was added to the `assetic` configuration:
assetic:
bundles: []
The default `swiftmailer` configuration now has the `spool` setting configured
to the `memory` type to defer email sending after the response is sent to the
user (recommended for better end-user performance):
swiftmailer:
spool: { type: memory }
The `jms_security_extra` configuration was moved to the `security.yml`
configuration file.
### `app/config/config_dev.yml`
An example of how to send all emails to a unique address was added:
#swiftmailer:
# delivery_address: me@example.com
### `app/config/config_test.yml`
The `storage_id` setting must be changed to `session.storage.mock_file`:
framework:
session:
storage_id: session.storage.mock_file
### `app/config/parameters.ini`
The file has been converted to a YAML file which reads as follows:
parameters:
database_driver: pdo_mysql
database_host: localhost
database_port: ~
database_name: symfony
database_user: root
database_password: ~
mailer_transport: smtp
mailer_host: localhost
mailer_user: ~
mailer_password: ~
locale: en
secret: ThisTokenIsNotSoSecretChangeIt
Note that if you convert your parameters file to YAML, you must also change
its reference in `app/config/config.yml`.
### `app/config/routing_dev.yml`
The `_assetic` entry was removed:
#_assetic:
# resource: .
# type: assetic
### `app/config/security.yml`
Under `security.access_control`, the default rule for internal routes was changed:
security:
access_control:
#- { path: ^/_internal/secure, roles: IS_AUTHENTICATED_ANONYMOUSLY, ip: 127.0.0.1 }
Under `security.providers`, the `in_memory` example was updated to the following:
security:
providers:
in_memory:
memory:
users:
user: { password: userpass, roles: [ 'ROLE_USER' ] }
admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
### `app/AppKernel.php`
The following bundles have been added to the list of default registered bundles:
new JMS\AopBundle\JMSAopBundle(),
new JMS\DiExtraBundle\JMSDiExtraBundle($this),
You must also rename the DoctrineBundle from:
new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
to:
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
### `web/app.php`
The default `web/app.php` file now reads as follows:
<?php
use Symfony\Component\ClassLoader\ApcClassLoader;
use Symfony\Component\HttpFoundation\Request;
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
// Use APC for autoloading to improve performance.
// Change 'sf2' to a unique prefix in order to prevent cache key conflicts
// with other applications also using APC.
/*
$loader = new ApcClassLoader('sf2', $loader);
$loader->register(true);
*/
require_once __DIR__.'/../app/AppKernel.php';
//require_once __DIR__.'/../app/AppCache.php';
$kernel = new AppKernel('prod', false);
$kernel->loadClassCache();
//$kernel = new AppCache($kernel);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
### `web/app_dev.php`
The default `web/app_dev.php` file now reads as follows:
<?php
use Symfony\Component\HttpFoundation\Request;
// If you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
//umask(0000);
// This check prevents access to debug front controllers that are deployed by accident to production servers.
// Feel free to remove this, extend it, or make something more sophisticated.
if (isset($_SERVER['HTTP_CLIENT_IP'])
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|| !in_array(@$_SERVER['REMOTE_ADDR'], array(
'127.0.0.1',
'::1',
))
) {
header('HTTP/1.0 403 Forbidden');
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
require_once __DIR__.'/../app/AppKernel.php';
$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
deny from all
\ No newline at end of file
<?php
require_once __DIR__.'/AppKernel.php';
use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;
class AppCache extends HttpCache
{
}
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\AopBundle\JMSAopBundle(),
new JMS\DiExtraBundle\JMSDiExtraBundle($this),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
new FOS\UserBundle\FOSUserBundle(),
new WLM\JuryToolBundle\WLMJuryToolBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
}
return $bundles;
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
}
}
<!DOCTYPE html>
<html>
<head>
<title>Wiki Loves Monuments - Jury Tool</title>
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojo/dojo.js"></script>
</head>
<body>
<header>
<img
src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/f3/LUSITANA_WLM_2011_d.svg/200px-LUSITANA_WLM_2011_d.svg.png"
alt="Wiki Loves Monuments Logo" title="Wiki Loves Monuments Logo">
<h1>{% block title %}{% endblock %}</h1>
</header>
<article>
<div>
{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %} {{
'layout.logged_in_as'|trans({'%username%': app.user.username},
'FOSUserBundle') }} | <a
href="{{ path('fos_user_security_logout') }}"> {{
'layout.logout'|trans({}, 'FOSUserBundle') }} </a> {% else %} <a
href="{{ path('fos_user_security_login') }}">{{
'layout.login'|trans({}, 'FOSUserBundle') }}</a> {% endif %}
</div>
{% for type, messages in app.session.flashbag.all() %} {% for key,
message in messages %}
<div class="flash-{{ type }}">{{ message|trans({}, 'FOSUserBundle') }}
</div>
{% endfor %} {% endfor %}
<div>{% block fos_user_content %} {% endblock fos_user_content %}</div>
</article>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>{% block title %}Welcome!{% endblock %}</title>
{% block stylesheets %}{% endblock %}
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
</head>
<body>
{% block body %}{% endblock %}
{% block javascripts %}{% endblock %}
</body>
</html>
This diff is collapsed.