SFYNX

SFYNX is not just to simplify the developper's work, and to speed up the creation and maintenance of your PHP web applications. It also allows you to create your own CMS. It's a CMF easy to use, build your own template (layout), add your own custom block with your own logic, build all the widget you need.

View project on GitHub

CMF SFYNX Bundles

SFYNX is not just to simplify the developper's work, and to speed up the creation and maintenance of your PHP web applications. It also allows you to create your own CMS. It's a CMF easy to use, build your own template (layout), add your own custom block with your own logic, build all the widget you need.

Project PI-GROUPE Development

For more information :

Structure of the framework

The framework works with Symfony 2.3 and has been split into 17 bundles :

* CoreBundle : A bundle which provides models of classes allowing to work and develop with doctrine (translation, tree, CRUD  generate Datatable table and multi-forms)
* AuthBundle : A bundle which overload the FOSUserBundle with role, permission and group dynamic system, and set handlers for login behavior, logout behavior and failure connection behavior
* ToolBundle : A bundle which provides tool libraries and services of route and role and twig extensions
* BehatBundle : A bundle which provides context tools to run mink tests
* MigrationBundle : A bundle which provides a command to set migration files with a version handler
* CmfBundle : A bundle which construct all the CMF with all managers of the creation of page with blocks and widgets.
( management varnish and memcache with reverse proxy, search lucene manager, render ESI, SEO pages, etc. )
* GedmoBundle : A bundle which is used to create a project with the CMF.
* MediaBundle : A bundle which overload the SonataMediaBundle, with crop system.
* TranslatorBundle : A bundle which provides entity and models of classes allowing to work with translation words.
* TemplateBundle :  A bundle which is used to stock all template of layout and others.
* SmoothnessBundle: A bundle which is used to define a complet admin template with all layers
* CacheBundle : A bundle which provides classes to cache handlers (memcache, files).
* DatabaseBundle : A bundle which provides classes and commands to run DB vendor`s utilities to backup and restore databases. 
* AclManagerBundle : A bundle which provides classes to run ACL Manager`s utilities for Symfony2.
* BrowserBundle : A bundle which provides library to run Browscap Manager`s utilities and MobileDetect Manager`s utilities.
* WsBundle : A bundle which provides web services allowing to connect authentication service with the SS0 protocol.
* WsseBundle : A bundle which provides web services allowing to connect authentication service with the Wsse protocol.
* EncryptBundle : A bundle which provides annotations to encrypt fields
* PositionBundle : A bundle which provides annotations to manage position of entiy rows
* AdminBundle : A bundle which overload the SonataAdminBundle.

Documentation

License

Copyright © 20012-2014, contact@pi-groupe.fr. This bundle is under the GNU General Public License, permitting combination and redistribution with software that uses the MIT License

SFYNX is a free software distributed under the GPL license. This license guarantees the following freedoms:

- the freedom to install and use SFYNX for any usage whatsoever;
- the freedom to look into SFYNX’s code and adapt it to your own needs by modifying the source code, to which you have direct access since SFYNX is entirely developed in PHP;
- the freedom to distribute copies of the software to anyone, provided you do not modify or delete the license;
- the freedom to enhance SFYNX and to distribute your enhancements among the public so that the entire community may benefit from it, provided you do not modify or delete the license.
  • This application is a free software; you can distribute it and/or modify it according to the terms of the GNU General Public License, as published by the Free Software Foundation; version 2 or (upon your choice) any later version.

  • This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; not even the implicit warranty for COMMERCIALISATION or CUSTOMISATION FOR A PARTICULAR PURPOSE. For more details, refer to the GNU General Public License.

  • A copy of the GNU General Public License must be provided with this software; if it is not, please write to the Free Software Foundation Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

  • You can download this software from http://pigroupe.github.io/cmf-sfynx/; you will also find a complete user manual and additional information on this site.

  • In French law, SFYNX falls under the regulations stipulated in the code of intellectual property rights (CPI). The SFYNX kernel is a collaborative work by its authors, listed above as per article L 113-1 of the CPI. The entire SFYNX project is comprised of a collective work in respect of articles L 113-2 and L 113-5 of the CPI. The authors release the work to the public in accordance with the rights and obligations as defined by the GNU public license.

Installing automaticly all-in-one

We have create an installer script shell which execute th e sfynx install.

    chmod +x sysadmin/scriptshell/installer-sfynx.sh
    ./sysadmin/scriptshell/installer-sfynx.sh

After you will have to execute the installation step-by-step from the step 6.

Installation step-by-step

Step 1: Configuring Serveur

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

Required :

  • PHP with at least version 5.3.2 of PHP (php5.4.4 recommended)
  • Sqlite3 must be enabled
  • JSON must be enabled
  • Ctype must be enabled
  • PHP-XML module must be installed
  • Installtion the gd library (for images)
  • PHP.ini must have the extensions:

    • php-pear php5-dev php5-gd php5-curl php5-imap php5-mcrypt
    • php5-geoip avec la database GeoLiteCountry/GeoIP.dat.gz (optional)
    • php-apc avec APC 3.0.17+
    • Intl (php5-intl) doit être installé avec ICU 4+
    • timezonedb pour le parametre date.timezone
    • JSON doit être activé
    • pdo, pdo_mysql
    • php5-memcache / php5-memcached (optional)
    • activation d'envoi de mail
      • sous windows :
        • SMTP = smtp-host-value
        • smtp_port = smtp-port-value
      • sous linux :
        • sendmail_path = "var-bin-sendmail"

Step 2: Installing the vendor

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

Setting vendor with composer.json

    php -d memory_limit=1024M composer.phar install --no-interaction
    php composer.phar dump-autoload --optimize

Step 3: Setting up Permissions

  • The directories below should be writable by both the web server and the user.
  • On a UNIX system, if your web server is different from your user, you can run the following commands once in your project to ensure that the permissions are correctly installed.
  • We must change www-data on your web server.

Many systems allow you to use ACL chmod a +. For more information : http://symfony.com/doc/current/book/installation.html

    mkdir -p app/cachesfynx/loginfailure
    mkdir -p web/uploads/media
    mkdir web/yui

    chmod -R 0777 app/cachesfynx
    chmod -R 0777 app/cache
    chmod -R 0777 app/logs
    chmod -R 0777 web/uploads
    chmod -R 0777 web/yui

Step 4: Create database, tables and fixtures with phing

Execute initialize.xml configuration

    bin/phing -f app/config/phing/initialize.xml rebuild

Step 5: Create database, tables and fixtures without phing

Type the following command to create the database

    php  app/console  doctrine:database:create

Type the following command to create the tables

    php  app/console  doctrine:schema:create

Type the following command to install fixtures of the tables

    php  app/console  doctrine:fixtures:load
    php  app/console  sfynx:classification:fixtures

Type the following command to install assets of the bundles

    php app/console assets:install web

For more information : http://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html

Step 6: Create the Virtual host file

Create the virtualhost file like this

    sudo nano /etc/apache2/sites-available/sfynx.conf

And in this file insert following code

    <VirtualHost *:80>
            ServerName  www.sfynx.local
            ServerAlias www.sfynx.local             
            DocumentRoot /var/www/cmf-sfynx/web/
            <Directory "/var/www/cmf-sfynx/web">
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride None
                    RewriteEngine On

                    RewriteCond %{REQUEST_FILENAME} !-f
                    RewriteRule ^(.*)$ app_dev.php [QSA,L]

                    #php_value auto_prepend_file "/var/www/xhprof/external/header.php"
                    #php_value auto_append_file "/var/www/xhprof/external/footer.php"

                    #Require all granted
                    Order allow,deny
                    allow from all
            </Directory>
            ErrorLog ${APACHE_LOG_DIR}/error_sfynx_dev.log
            LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" varnishcombined
            CustomLog ${APACHE_LOG_DIR}/access-dev.log varnishcombined
    </VirtualHost>

    <VirtualHost *:80>
            ServerName  test.sfynx.local
            ServerAlias test.sfynx.local
            DocumentRoot /var/www/cmf-sfynx/web/
            <Directory "/var/www/cmf-sfynx/web">
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride None
                    RewriteEngine On

                    RewriteCond %{REQUEST_FILENAME} !-f
                    RewriteRule ^(.*)$ app_test.php [QSA,L]

                    #php_value auto_prepend_file "/var/www/xhprof/external/header.php"
                    #php_value auto_append_file "/var/www/xhprof/external/footer.php"

                    #Require all granted
                    Order allow,deny
                    allow from all
            </Directory>
            ErrorLog ${APACHE_LOG_DIR}/error_sfynx_test.log
            LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" varnishcombined
            CustomLog ${APACHE_LOG_DIR}/access-test.log varnishcombined
    </VirtualHost>

And run a2ensite to create the alias

    a2enmod rewrite
    a2enmod expires
    sudo a2ensite sfynx

Then update the hosts file /etc/hosts

    sudo nano /etc/hosts

And add these lines

    127.0.0.1       www.sfynx.local
    127.0.0.1       test.sfynx.local

Step 7: Connexion on /login

To connect as default super administrator:

    Username: superadmin
    Password: superadmin

The password must be changed at the first use.

Step 8: Run the phpunit tests

    bin/phpunit -c app vendor/sfynx-project
    casperjs test app/Tests/casperjs/ --base-url=127.0.0.1:4042 --pre=app/Resources/casperjs/pre.js

Step 9: Run Behat tests

In first step, you have to install and configure Selenium Server :

Download the Selenium Server from the project website. Run the server with the following command (update the version number to the one you downloaded):

    java -jar selenium-server-standalone-2.44.0.jar

After you just have to run behat.

To test the connexion handler

    bin/behat --suite=auth
    or
    php app/console sfynx:behat:execute --env=test --suite=auth

To test the Cmf (creation of page with widget)

    bin/behat --suite=cmf
    or
    php app/console sfynx:behat:execute --env=test --suite=cmf