Browse Source

Merge pull request #1589 from sanjoydesk/master

PHP: Add Cygnite PHP Framework
Hamilton Turner 10 years ago
parent
commit
26a069b45e
53 changed files with 1696 additions and 1 deletions
  1. 1 0
      .travis.yml
  2. 1 1
      frameworks/PHP/codeigniter/install.sh
  3. 63 0
      frameworks/PHP/cygnite-php-framework/.gitignore
  4. 28 0
      frameworks/PHP/cygnite-php-framework/.htaccess
  5. 8 0
      frameworks/PHP/cygnite-php-framework/.travis.yml
  6. 20 0
      frameworks/PHP/cygnite-php-framework/LICENSE
  7. 54 0
      frameworks/PHP/cygnite-php-framework/README.md
  8. 1 0
      frameworks/PHP/cygnite-php-framework/apps/.htaccess
  9. 0 0
      frameworks/PHP/cygnite-php-framework/apps/components/authentication/.gitkeep
  10. 0 0
      frameworks/PHP/cygnite-php-framework/apps/components/form/.gitkeep
  11. 235 0
      frameworks/PHP/cygnite-php-framework/apps/configs/application.php
  12. 35 0
      frameworks/PHP/cygnite-php-framework/apps/configs/autoload.php
  13. 55 0
      frameworks/PHP/cygnite-php-framework/apps/configs/database.php
  14. 77 0
      frameworks/PHP/cygnite-php-framework/apps/configs/definitions/DefinitionManager.php
  15. 69 0
      frameworks/PHP/cygnite-php-framework/apps/configs/migration.php
  16. 27 0
      frameworks/PHP/cygnite-php-framework/apps/configs/services.php
  17. 105 0
      frameworks/PHP/cygnite-php-framework/apps/configs/session.php
  18. 94 0
      frameworks/PHP/cygnite-php-framework/apps/controllers/BenchController.php
  19. 80 0
      frameworks/PHP/cygnite-php-framework/apps/controllers/HomeController.php
  20. 0 0
      frameworks/PHP/cygnite-php-framework/apps/database/.gitkeep
  21. 0 0
      frameworks/PHP/cygnite-php-framework/apps/database/migrations/.gitkeep
  22. 0 0
      frameworks/PHP/cygnite-php-framework/apps/extensions/.gitkeep
  23. 0 0
      frameworks/PHP/cygnite-php-framework/apps/languages/english/.gitkeep
  24. 25 0
      frameworks/PHP/cygnite-php-framework/apps/models/Fortune.php
  25. 24 0
      frameworks/PHP/cygnite-php-framework/apps/models/World.php
  26. 0 0
      frameworks/PHP/cygnite-php-framework/apps/modules/admin/Controllers/.gitkeep
  27. 0 0
      frameworks/PHP/cygnite-php-framework/apps/modules/admin/Models/.gitkeep
  28. 0 0
      frameworks/PHP/cygnite-php-framework/apps/modules/admin/Views/.gitkeep
  29. 13 0
      frameworks/PHP/cygnite-php-framework/apps/routerconfig.php
  30. 56 0
      frameworks/PHP/cygnite-php-framework/apps/routes.php
  31. 0 0
      frameworks/PHP/cygnite-php-framework/apps/services/Payment/.gitkeep
  32. 0 0
      frameworks/PHP/cygnite-php-framework/apps/temp/cache/.gitkeep
  33. 0 0
      frameworks/PHP/cygnite-php-framework/apps/temp/database/.gitkeep
  34. 0 0
      frameworks/PHP/cygnite-php-framework/apps/temp/logs/.gitkeep
  35. 0 0
      frameworks/PHP/cygnite-php-framework/apps/temp/sessions/.gitkeep
  36. 0 0
      frameworks/PHP/cygnite-php-framework/apps/temp/twig/tmp/cache/.gitkeep
  37. 20 0
      frameworks/PHP/cygnite-php-framework/apps/views/bench/fortunes.view.php
  38. 124 0
      frameworks/PHP/cygnite-php-framework/apps/views/home/welcome.view.php
  39. 81 0
      frameworks/PHP/cygnite-php-framework/apps/views/layout/home.view.php
  40. 0 0
      frameworks/PHP/cygnite-php-framework/assets/css/.gitkeep
  41. 0 0
      frameworks/PHP/cygnite-php-framework/assets/img/.gitkeep
  42. BIN
      frameworks/PHP/cygnite-php-framework/assets/img/cygnite/favicon.ico
  43. BIN
      frameworks/PHP/cygnite-php-framework/assets/img/cygnite/fevicon.png
  44. 0 0
      frameworks/PHP/cygnite-php-framework/assets/js/.gitkeep
  45. 44 0
      frameworks/PHP/cygnite-php-framework/benchmark_config.json
  46. 61 0
      frameworks/PHP/cygnite-php-framework/boot/initialize.php
  47. 39 0
      frameworks/PHP/cygnite-php-framework/boot/start.php
  48. 27 0
      frameworks/PHP/cygnite-php-framework/composer.json
  49. 9 0
      frameworks/PHP/cygnite-php-framework/deploy/cygnite-php-framework
  50. 133 0
      frameworks/PHP/cygnite-php-framework/deploy/nginx.conf
  51. 60 0
      frameworks/PHP/cygnite-php-framework/index.php
  52. 12 0
      frameworks/PHP/cygnite-php-framework/install.sh
  53. 15 0
      frameworks/PHP/cygnite-php-framework/setup.sh

+ 1 - 0
.travis.yml

@@ -99,6 +99,7 @@ env:
     - "TESTDIR=PHP/cakephp"
     - "TESTDIR=PHP/cakephp"
     - "TESTDIR=PHP/hhvm"
     - "TESTDIR=PHP/hhvm"
     - "TESTDIR=PHP/php"
     - "TESTDIR=PHP/php"
+    - "TESTDIR=PHP/cygnite-php-framework"
     - "TESTDIR=PHP/codeigniter"
     - "TESTDIR=PHP/codeigniter"
     - "TESTDIR=PHP/php-fatfree"
     - "TESTDIR=PHP/php-fatfree"
     - "TESTDIR=PHP/fuel"
     - "TESTDIR=PHP/fuel"

+ 1 - 1
frameworks/PHP/codeigniter/install.sh

@@ -9,4 +9,4 @@ fw_depends php nginx composer
 
 
 ${PHP_HOME}/bin/php ${COMPOSER_HOME}/composer.phar install \
 ${PHP_HOME}/bin/php ${COMPOSER_HOME}/composer.phar install \
   --no-interaction --working-dir $TROOT \
   --no-interaction --working-dir $TROOT \
-  --no-progress --optimize-autoloader 
+  --no-progress --optimize-autoloader

+ 63 - 0
frameworks/PHP/cygnite-php-framework/.gitignore

@@ -0,0 +1,63 @@
+
+
+#Build System
+**/builds/*
+
+#bower
+/bower_components
+
+#Binary files
+/bin/
+
+#Grunt
+/node_modules/*
+
+# Composer
+/vendor/
+composer.phar
+composer.lock
+
+# Code Coverage
+build/coverage/*
+
+# always-ignore extensionsalways-ignore extensions
+*.diff
+*.err
+*.orig
+*.log
+*.rej
+*.swo
+*.swp
+*.vi
+*~
+*.sass-cache
+
+# OS or Editor folders
+.DS_Store
+Thumbs.db
+.cache
+.project
+.settings
+.tmproj
+*.esproj
+nbproject
+
+# Dreamweaver added files
+_notes
+dwsync.xml
+
+# Komodo
+*.komodoproject
+.komodotools
+
+# Folders to ignore
+.hg
+.svn
+.CVS
+intermediate
+publish
+.idea
+
+
+#Arcanist
+.arcconfig

+ 28 - 0
frameworks/PHP/cygnite-php-framework/.htaccess

@@ -0,0 +1,28 @@
+# Apache configuration file
+# http://httpd.apache.org/docs/2.2/mod/quickreference.html
+
+# Note: ".htaccess" files are an overhead for each request. This logic should
+# be placed in your Apache config whenever possible.
+# http://httpd.apache.org/docs/2.2/howto/htaccess.html
+
+# Turning on the rewrite engine is necessary for the following rules and
+# features. "+FollowSymLinks" must be enabled for this to work symbolically.
+
+<IfModule mod_rewrite.c>
+	Options +FollowSymLinks
+	RewriteEngine On
+	php_value safe_mode off
+</IfModule>
+
+# For all files not found in the file system, reroute the request to the
+# "index.php" front controller, keeping the query string intact
+
+<IfModule mod_rewrite.c>
+	RewriteCond %{REQUEST_FILENAME} !-f
+	RewriteCond %{REQUEST_FILENAME} !-d
+	RewriteRule ^(.*)$ index.php/$1 [L]
+	
+</IfModule>
+
+Order allow,deny
+Allow from all

+ 8 - 0
frameworks/PHP/cygnite-php-framework/.travis.yml

@@ -0,0 +1,8 @@
+language: php
+
+php:
+  - 5.4
+  - 5.5
+
+before_script:
+  - "composer install"

+ 20 - 0
frameworks/PHP/cygnite-php-framework/LICENSE

@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2013-2014 Cygnite Framework <Sanjoy Dey>
+
+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.

+ 54 - 0
frameworks/PHP/cygnite-php-framework/README.md

@@ -0,0 +1,54 @@
+Skeleton Application Using Cygnite PHP Framework
+------------------------------------------------------------------
+
+[![Latest Stable Version](https://poser.pugx.org/cygnite/cygnite-application/v/stable.svg)](https://packagist.org/packages/cygnite/cygnite-application) [![Total Downloads](https://poser.pugx.org/cygnite/cygnite-application/downloads.svg)](https://packagist.org/packages/cygnite/cygnite-application) [![Latest Unstable Version](https://poser.pugx.org/cygnite/cygnite-application/v/unstable.svg)](https://packagist.org/packages/cygnite/cygnite-application) [![License](https://poser.pugx.org/cygnite/cygnite-application/license.svg)](https://packagist.org/packages/cygnite/cygnite-application)
+
+Sample skeleton application using the Cygnite MVC layer - http://www.cygniteframework.com
+
+>  Note: This repository contains the skeleton application of the Cygnite Framework. If you would like to contribute
+on Cygnite Framework, please visit the core [repository](https://github.com/cygnite/framework).
+
+Installation
+--------------
+The best way to install Cygnite Framework is to download composer.phar from http://getcomposer.org/ to your local directory or to use globally on your system move it to
+usr/local/bin. For windows users please download and install composer setup.
+
+You may install Cygnite Framework either simply downloading skeleton application from github repository or install via composer. Composer installation is more convenient.
+
+
+Composer: Create Project
+--------------------------------
+Create your project from terminal by simply entering below command.
+
+    composer create-project cygnite/cygnite-application cygnite --prefer-dist
+                                        or
+    composer.phar create-project cygnite/cygnite-application cygnite --prefer-dist
+
+That's all you are ready to build your awesome application.
+
+
+##Contribute -
+------------------
+-> Getting bored with the same kind of development all time?
+
+-> Would you like to be well recognised by professionals ?
+
+-> Do you want to learn something interesting and showcase your skills to grab better position ?
+
+You are at right place. We welcome you to participate on Cygnite Framework development or its documentation.
+
+Contribute on Cygnite Framework development and grow with us. Join the team, learn, get help and help others, find, report bugs, send us your feedback,
+send your wishlist for new features, write and send us patches for Cygnite Framework.
+
+
+##Getting Started with Cygnite -
+-----------------------------------------
+i.  Make sure you have GitHub Account.
+
+ii. Clearly describe the issue you find to fix shortly.
+
+iii. Create a branch where you would like to place your changes and send the patches to us.
+
+iv.  Fork cygnite/framework repository on GitHub.
+
+v. Please follow the PSR coding standard as followed  while contributing or please request for coding standard to follow.

+ 1 - 0
frameworks/PHP/cygnite-php-framework/apps/.htaccess

@@ -0,0 +1 @@
+Deny from all

+ 0 - 0
frameworks/PHP/cygnite-php-framework/apps/components/authentication/.gitkeep


+ 0 - 0
frameworks/PHP/cygnite-php-framework/apps/components/form/.gitkeep


+ 235 - 0
frameworks/PHP/cygnite-php-framework/apps/configs/application.php

@@ -0,0 +1,235 @@
+<?php
+if (!defined('CF_SYSTEM')) {
+    exit('External script access not allowed');
+}
+/**
+ *  Cygnite Framework
+ *  Global Configuration Settings
+ *
+ *  An open source application development framework for PHP 5.3x or newer
+ *
+ *   License
+ *
+ *   This source file is subject to the MIT license that is bundled
+ *   with this package in the file LICENSE.txt.
+ *   http://www.cygniteframework.com/license.txt
+ *   If you did not receive a copy of the license and are unable to
+ *   obtain it through the world-wide-web, please send an email
+ *   to [email protected] so I can send you a copy immediately.
+ *
+ * @package            :  Apps
+ * @subpackages        :  Configs
+ * @filename           :  application
+ * @description        :  You can set your all your global configurations here.
+ * @author             :  Sanjoy Dey
+ * @copyright          :  Copyright (c) 2013 - 2014,
+ * @link               :  http://www.cygniteframework.com
+ * @since              :  Version 1.0
+ * @filesource
+ * @warning            :  If you don't protect this directory from direct web access,
+ *                     anybody will be able to see your configuration and settings.
+ *
+ *
+ */
+
+return array(
+    /**
+     *--------------------------------------------------------------------------
+     * Your Application Base URL
+     *--------------------------------------------------------------------------
+     * The base URL used to import your application assets in your web page.
+     * Based on base url we will perform page redirect and other internal
+     * functionality.
+     *
+     */
+    'base_path' => '',
+    /*
+    *--------------------------------------------------------------------------
+    * Your Application Default Controller
+    *--------------------------------------------------------------------------
+    * Set your application default controller here. Default controller
+    * will be called when you try to access cygnite application.
+    */
+    'default_controller' => 'Home',
+    /*
+    *--------------------------------------------------------------------------
+    * Your Application Default Method
+    *--------------------------------------------------------------------------
+    * You can set your application default method here. By default we
+    * we will call index method of your controller.
+    * You can also change the default method.
+    *
+    */
+    'default_method' => 'index',
+
+    /*
+    *---------------------------------------------------------------------------
+    * Set Application Environment
+    *---------------------------------------------------------------------------
+    * You can set your application environment in order to handle errors and exceptions.
+    * Development mode all errors are turned on. So that you can able to fix all issues easily.
+    * Errors will be turned off in production server mode.
+    *
+    * Example :
+    * environment => 'development/production'
+    */
+    'environment' => 'production', //Errors are turned on in development environment
+
+    /*
+    *--------------------------------------------------------------------------
+    * Your Application Character Encoding
+    *--------------------------------------------------------------------------
+    * Here you can set your application default character encoding . This encoding
+    * will be used by the Str, Text, Form, and any other classes that need
+    *  to know what type of encoding to use for your generous application.
+    *
+    */
+    'encoding' => 'UTF-8',
+    /*
+    *--------------------------------------------------------------------------
+    * Your Application Language
+    *--------------------------------------------------------------------------
+    * You can set your application default language here. Language library will
+    * will take care rest.
+    */
+    'language' => 'en',
+    /*
+    *--------------------------------------------------------------------------
+    * Application Timezone
+    *--------------------------------------------------------------------------
+    * You can set your application timezone here.This timezone will
+    * be used when cygnite need date time or any internal features.
+    *
+    */
+    'timezone' => 'UTC',
+    /*
+    *--------------------------------------------------------------------------
+    *  Application Encryption key
+    *--------------------------------------------------------------------------
+    * Set your encryption key here. You must set your encryption key here in order to
+    * use cygnite secure encryption and session library. We used php mcrypt extension
+    * library for encryption library. So please check whether you have else please activate
+    * to work with secure encryption and session library.
+    */
+    'cf_encryption_key' => 'cygnite-shaXatBNHQ4',
+    /*
+    *--------------------------------------------------------------------------
+    * Benchmark Your Application
+    *--------------------------------------------------------------------------
+    * Enable profiling as True if you wish to benchmark your application. You can
+    * make it FALSE to deactivate profiling. Cygnite will take care rest.
+    */
+    'enable_profiling' => false,
+    /*
+    *--------------------------------------------------------------------------
+    * ************Your Application Cache Config*************
+    *--------------------------------------------------------------------------
+    * You can enable cache here (example: TRUE/FALSE). Cygnite have
+    * three type of cache driver FileCache, Memcache, APC to boost your
+    * application performace. Follow user guide for usages.
+    */
+    'enable_cache' => false,
+    /*
+    *---------------------------------------------------------------------------
+    * Cache Name
+    *---------------------------------------------------------------------------
+    * Set your cache name here to generate cache file name if you are
+    * using cygnite file caching technique.
+    */
+    'cache_name' => 'file.cache',
+    /*
+    *---------------------------------------------------------------------------
+    * Cache Extension
+    *---------------------------------------------------------------------------
+    * Set your cache extension here. Cygnite will take care of rest. Cache will
+    * store with same extension which you will provide here.
+    *
+    */
+    'cache_extension' => '.cache',
+    /*
+    *---------------------------------------------------------------------------
+    * Cache Type
+    *---------------------------------------------------------------------------
+    * Set your cache type here. Cygnite will take care of rest.
+    *
+    */
+    'cache_type' => 'file',
+    /*
+    *---------------------------------------------------------------------------
+    * Cache Storage Location
+    *---------------------------------------------------------------------------
+    * Set your cache file storage location here. By default we are using
+    * temp/cache.
+    *
+    */
+    'cache_directory' => 'temp.cache', //Default value is none
+
+    /**
+     *---------------------------------------------------------------------------
+     * Cygnite Application Logs
+     *---------------------------------------------------------------------------
+     * If you enable debugger will generate error logs into apps/temp/logs/
+     *
+     */
+    'enable_logging' => false,
+    /*
+    *---------------------------------------------------------------------------
+    * Logs File Name
+    *---------------------------------------------------------------------------
+    * Set your log file name here. Your applications logs will generate
+    * by cygnite engine and store as filename you provide here.
+    *
+    */
+    //'log_file_name'                => 'application_logs' ,
+    /*
+    *---------------------------------------------------------------------------
+    * Logs Storage Location
+    *---------------------------------------------------------------------------
+    * Set your log storage location here. By default we are using
+    * temp/logs.
+    *
+    */
+    'log_path' => 'apps.temp.logs',
+
+    /**
+     * Enable error emailing. When any error occur in production
+     * Mode email will trigger. Set true or false
+     */
+    'enable_error_emailing' => false,
+
+    /*
+     * Email Configurations
+     */
+    'email_configurations' => array(
+
+        'protocol' => 'smtp',
+
+        'smtp' => array(
+            'host' => 'smtp.gmail.com',
+            'username' => 'your gmail id',
+            'password' => 'your password',
+            'port' => '465',
+            'encryption' => 'ssl',
+        ),
+        'sendmail' => array(
+            'path' => '/usr/sbin/exim -bs'
+        ),
+
+    ),
+    'params' => array(
+
+        /*
+        | You can define your params here.
+        | All your params defined here has access
+        | globally in your application.
+        */
+        'admin_email' => '[email protected]',
+
+        /*
+        | We will make use of email address to send error log
+        | when application is in production mode.
+        |
+        */
+        'log_email' => '[email protected]',
+    ),
+);

+ 35 - 0
frameworks/PHP/cygnite-php-framework/apps/configs/autoload.php

@@ -0,0 +1,35 @@
+<?php
+/**
+ * This file is part of the Cygnite package.
+ *
+ * (c) Sanjoy Dey <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace Cygnite\Foundation;
+
+if (!defined('CF_SYSTEM')) {
+    exit('External script access not allowed');
+}
+
+return array(
+    /*---------------------------------------------------------------------------
+    * Register all your directories to auto load your files.
+    *---------------------------------------------------------------------------
+    * You can specify multiple numbers of directories here to register on
+    * Cygnite Engine during runtime. Don't worry about the application
+    * performance because all libraries are lazy loaded. But filename,
+    * class name and file should be same, StudlyCaps.
+    *
+    *  Specify your directory path here. That's all. Cygnite will
+    *  take care of rest.
+    */
+    Application::instance()->registerDirectories(
+        array(
+            'apps.controllers',
+            'apps.models',
+            'apps.configs.definitions'
+        )
+    )
+);

+ 55 - 0
frameworks/PHP/cygnite-php-framework/apps/configs/database.php

@@ -0,0 +1,55 @@
+<?php
+/*
+ * This file is part of the Cygnite package.
+ *
+ * (c) Sanjoy Dey <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+namespace Cygnite\Database;
+
+if (!defined('CF_SYSTEM')) {
+    exit('External script access not allowed');
+}
+
+/**
+ * Initialize your database configurations settings here.
+ * You can connect with multiple database on the fly.
+ * Don't worry about performance Cygnite will not
+ * connect with database until first time you need your
+ * connection to interact with database.
+ * Specify your database name and table name in model to
+ * do crude operations.
+ *
+ * Please protect this file to have maximum security.
+ */
+Configuration::initialize(
+    function ($config) {
+        $config->default = 'db';
+        $config->setConfig(
+            array(
+                'db' => array(
+                    'driver' => 'mysql',
+                    'host' => '127.0.0.1',
+                    'port' => '',
+                    'database' => 'hello_world',
+                    'username' => 'benchmarkdbuser',
+                    'password' => 'benchmarkdbpass',
+                    'charset' => 'utf8'
+                )
+                /*'db1' => array(
+                    'driver' => 'mysql',
+                    'host' => 'localhost',
+                    'port' => '',
+                    'database' => '',
+                    'username' => '',
+                    'password' => '',
+                    'charset' => 'utf8'
+                )*/
+            )
+        );
+    }
+);
+
+

+ 77 - 0
frameworks/PHP/cygnite-php-framework/apps/configs/definitions/DefinitionManager.php

@@ -0,0 +1,77 @@
+<?php
+namespace Apps\Configs\Definitions;
+
+if (!defined('CF_SYSTEM')) {
+    exit('External script access not allowed');
+}
+/**
+ *  Cygnite Framework
+ *  Database Configuration Settings
+ *
+ *  An open source application development framework for PHP 5.3x or newer
+ *
+ *   License
+ *
+ *   This source file is subject to the MIT license that is bundled
+ *   with this package in the file LICENSE.txt.
+ *   http://www.cygniteframework.com/license.txt
+ *   If you did not receive a copy of the license and are unable to
+ *   obtain it through the world-wide-web, please send an email
+ *   to [email protected] so I can send you a copy immediately.
+ *
+ *@package               : Apps
+ *@subpackages           : Configurations
+ *@filename              : DefinitionManager.php
+ *@description           : Define all your property dependencies. Cygnite will
+ *                         inject your dependency at run time.
+ *@author                : Sanjoy Dey
+ *@copyright             : Copyright (c) 2013 - 2014,
+ *@link	                 : http://www.cygniteframework.com
+ *@since	             : Version 1.2
+ *@filesource
+ *
+ */
+
+ class DefinitionManager
+ {
+
+   /**
+      * Set controller property dependencies here.
+      * Cygnite will inject all your dependencies at runtime
+      *
+      * @return array
+      *  <code>
+      *   return
+      *     array(
+      *          'HomeController' => array(
+      *              'service' => 'apps.extensions.general',
+      *              'api' => 'apps.extensions.api'
+      *           ),
+      *          'ProductsController' => array(
+      *             'social' => 'apps.extensions.social-share',
+      *          ),
+      *      );
+      *  </code>
+      *
+      */
+     public function getPropertyDependencies()
+     {
+        return array();
+     }
+
+     /**
+      *
+      * @return type
+       *  <code>
+      *   return
+      *     array(
+      *          'GeneralInterface' => '\\Apps\\Extensions\\General',
+      *          'ORM' => '\\Cygnite\\Database\\ActiveRecord',
+      *      );
+      *  </code>
+      */
+     public function registerAlias()
+     {
+         return array();
+     }
+ }

+ 69 - 0
frameworks/PHP/cygnite-php-framework/apps/configs/migration.php

@@ -0,0 +1,69 @@
+<?php
+namespace Cygnite\Database;
+
+/**
+ *  Cygnite Framework
+ *  Database Migration Configuration Settings
+ *
+ *  An open source application development framework for PHP 5.3x or newer
+ *
+ *   License
+ *
+ *   This source file is subject to the MIT license that is bundled
+ *   with this package in the file LICENSE.txt.
+ *   http://www.cygniteframework.com/license.txt
+ *   If you did not receive a copy of the license and are unable to
+ *   obtain it through the world-wide-web, please send an email
+ *   to [email protected] so I can send you a copy immediately.
+ *
+ *@package               : Apps
+ *@subpackages           : Database Migration Configurations
+ *@filename              : migration.php
+ *@description           : You can set your session configurations here.
+ *@author                : Sanjoy Dey
+ *@copyright             : Copyright (c) 2013 - 2014,
+ *@link	                 : http://www.cygniteframework.com
+ *@since	             : Version 1.2
+ *@filesource
+ *@warning               : If you don't protect this directory from direct web access,
+ * anybody will be able to see your database configuration and settings.
+ *
+ *
+ */
+
+if (!defined('CF_SYSTEM')) {
+    exit('External script access not allowed');
+}
+
+/**
+ * Initialize your database configurations settings here.
+ * You can connect with multiple database on the fly.
+ * Don't worry about performance Cygnite will not
+ * connect with database until first time you need your
+ * connection to interact with database.
+ * Specify your database name and table name in model to
+ * do crude operations.
+ *
+ * <code>
+ * 'connection'  => 'your-database',
+ * 'migration_path' => 'migration-directory',
+ * 'migration_table' => 'migration-table-name',
+ *
+ * </code>
+ *
+ * Example :
+ * cd console/bin
+ * php cygnite migrate:init create_products_table 
+ * php cygnite migrate
+ */
+
+
+return array(
+    'connection' => 'cygnite', //If you don't specify your connection name Cygnite will take default database 
+    //connection to generate your migrations
+
+    'migration_path' => 'apps.migrations',
+
+    'migration_table' => 'migrations',
+
+);

+ 27 - 0
frameworks/PHP/cygnite-php-framework/apps/configs/services.php

@@ -0,0 +1,27 @@
+<?php
+use Cygnite\Foundation\Application as App;
+
+if (!defined('CF_SYSTEM')) {
+    exit('External script access not allowed');
+}
+
+// Register all service provider
+App::service(function ($app)
+{
+    // Add multiple Service Provider into the array
+    /*
+     $app->registerServiceProvider(
+        array(
+            "Apps\\Services\\Payment\\ApiServiceProvider",
+        )
+    );
+	
+    // Use Controller as Service manual configuration
+    $app['user.controller'] = function () use($app)
+    {
+        return new \Apps\Controllers\HelloController(new \Cygnite\Mvc\Controller\ServiceController, $app);
+    }; 
+	// OR 
+	// Controller as Service automatic configuration
+    $app->setServiceController('hello.controller', '\Application\Controllers\HelloController');*/
+});

+ 105 - 0
frameworks/PHP/cygnite-php-framework/apps/configs/session.php

@@ -0,0 +1,105 @@
+<?php
+if (!defined('CF_SYSTEM')) {
+    exit('External script access not allowed');
+}
+/**
+ * Cygnite PHP Framework
+ *
+ * Session Configuration
+ *
+ * @author Sanjoy Dey <[email protected]>
+ */
+
+return array(
+
+    /**
+     *----------------------------------------------------------
+     * Session Driver
+     *----------------------------------------------------------
+     * Set session driver to use native session or database
+     * based session. Just provide the driver as "native" or
+     * "database". Cygnite will take care of next.
+     */
+    'driver' => 'native', // native, database
+
+    /**
+     *----------------------------------------------------------
+     * Session Name
+     *----------------------------------------------------------
+     * Set your session name, else cygnite will use default name
+     */
+    'session_name'  => 'cf_secure_session',
+
+    /**
+     *----------------------------------------------------------
+     * Session Storage Path
+     *----------------------------------------------------------
+     * Leave it as default as it will store into the default session
+     * directory.
+     */
+    'path' => 'default',
+
+    /**
+     *----------------------------------------------------------
+     * Database For Session Storage
+     *----------------------------------------------------------
+     * Set the database name if you are using database based session
+     * in order to store session.
+     *
+     * Change database name below to use session database driver
+     */
+    'database_name' => 'cygnite',
+
+    /**
+     *----------------------------------------------------------
+     * Setting Table Name For Session Storage
+     *----------------------------------------------------------
+     * Provide table name if you are using database based session.
+     * By default "cf_sessions" is the table to store all session
+     * into table.
+     */
+    'table' => 'cf_sessions',
+
+    /**
+     *----------------------------------------------------------
+     * Use Session Cookie
+     *----------------------------------------------------------
+     * Configure to use session cookie or not
+     */
+    'use_session_cookie' => false,
+
+    /**
+     *----------------------------------------------------------
+     * Session Cookie Name
+     *----------------------------------------------------------
+     * If you are using session cookie then provide the name here else
+     * leave it blank.
+     */
+    'session_cookie_name' => '',
+
+    /**
+     *----------------------------------------------------------
+     * HTTP Only
+     *----------------------------------------------------------
+     * Configure to set httponly for cookie params
+     */
+    'httponly' => true,
+
+    /**
+     * --------------------------------------------------------
+     *  Set Session Time out
+     * --------------------------------------------------------
+     * Currently not implemented, you can change the session
+     * timeout in php.ini configuration file
+     */
+    'timeout' => 1440,
+
+    /**
+     *----------------------------------------------------------
+     * Secure Session
+     *----------------------------------------------------------
+     * You may leave it as false or true to use secure session
+     * By default cygnite provides most security to the session.
+     */
+    'secure' => false,
+);

+ 94 - 0
frameworks/PHP/cygnite-php-framework/apps/controllers/BenchController.php

@@ -0,0 +1,94 @@
+<?php
+namespace Apps\Controllers;
+
+use Cygnite\Mvc\Controller\AbstractBaseController;
+use Apps\Models\Fortune;
+use Apps\Models\World;
+
+class BenchController extends AbstractBaseController
+{
+    protected $templateEngine = false;
+
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    public function indexAction()
+    {
+        echo 'Hello World!';
+    }
+
+    public function dbAction()
+    {
+        $worlds = $arr = array();
+        $world = null;
+        $queries = 1;
+
+        $worlds = $this->getWorldsInfo($queries);
+        $worlds = $worlds[0];
+
+        header('Content-type: application/json');
+        echo json_encode($worlds);
+    }
+
+    private function getWorldsInfo($queries)
+    {
+        $world = null;
+        $worlds = $arr = array();
+
+        for ($i = 0; $i < $queries; ++$i) {
+            $world = World::find(mt_rand(1, 10000));
+            $arr['id'] = (int) $world->id;
+            $arr['randomNumber'] = (int) $world->randomnumber;
+            $worlds[] = $arr;
+        }
+
+        return $worlds;
+    }
+
+    public function queriesAction($queries = 1)
+    {
+        $queries = intval($queries);
+        if ($queries < 1 ) {
+            $queries = 1;
+        } elseif ($queries > 500) {
+            $queries = 500;
+        }
+
+        $worlds = array();
+        $worlds = $this->getWorldsInfo($queries);
+
+        header('Content-type: application/json');
+        echo json_encode($worlds);
+    }
+
+    public function fortunesAction()
+    {
+        $fortuneCollection = array();
+        $fortuneCollection = Fortune::all();
+        $fortunes = $fortuneCollection->asArray();
+
+        $runtimeFortune = new Fortune();
+        $runtimeFortune->id = 0;
+        $runtimeFortune->message = 'Additional fortune added at request time.';
+
+        $fortunes[] = $runtimeFortune;
+
+        usort($fortunes, function($left, $right) {
+
+            if ($left->message === $right->message) {
+                return 0;
+            } else if ($left->message > $right->message) {
+                return 1;
+            } else {
+                return -1;
+            }
+
+        });
+
+        $this->render('fortunes', array(
+                'fortunes' => $fortunes
+        ));
+    }
+}

+ 80 - 0
frameworks/PHP/cygnite-php-framework/apps/controllers/HomeController.php

@@ -0,0 +1,80 @@
+<?php
+namespace Apps\Controllers;
+
+use Cygnite\Foundation\Application;
+use Cygnite\Mvc\Controller\AbstractBaseController;
+
+class HomeController extends AbstractBaseController
+{
+    /**
+    * --------------------------------------------------------------------------
+    * The Default Controller
+    *--------------------------------------------------------------------------
+    *  This controller respond to uri beginning with home and also
+    *  respond to root url like "home/index"
+    *
+    * Your GET request of "home/index" will respond like below -
+    *
+    *      public function indexAction()
+    *     {
+    *            echo "Cygnite : Hellow ! World ";
+    *     }
+    * Note: By default cygnite doesn't allow you to pass query string in url, which
+    * consider as bad url format.
+    *
+    * You can also pass parameters into the function as below-
+    * Your request to  "home/form/2134" will pass to
+    *
+    *      public function formAction($id = ")
+    *      {
+    *             echo "Cygnite : Your user Id is $id";
+    *      }
+    * In case if you are not able to access parameters passed into method
+    * directly as above, you can also get the uri segment
+    *  echo Url::segment(3);
+    *
+    * That's it you are ready to start your awesome application with Cygnite Framework.
+    *
+    */
+
+    protected $layout = 'layout.home';
+
+    protected $templateEngine = false;
+
+   // protected $templateExtension = '.html.twig';
+
+   //protected $autoReload = true;
+     /*
+     * Your constructor.
+     * @access public
+     *
+     */
+    public function __construct()
+    {
+        parent::__construct();
+
+    }
+
+    /**
+     * Default method for your controller. Render welcome page to user.
+     * @access public
+     *
+     */
+   public function indexAction()
+   {
+       $this->render('welcome', array('title' => 'Welcome to Cygnite Framework'));
+   }
+   
+   public function hmvcAction($id)
+   {
+        //We are calling HMVC widget and return response
+		$widgetResponse = $this->call('modules.admin.controllers.user@index', array('id' => $id));
+		
+		//You should enable layout in order to access variable into view page
+       $this->render('application', array(
+                'messege' => 'Welcome to Cygnite framework',
+                'userwidget' => $widgetResponse
+        ));  
+   }
+
+}//End of your home controller

+ 0 - 0
frameworks/PHP/cygnite-php-framework/apps/database/.gitkeep


+ 0 - 0
frameworks/PHP/cygnite-php-framework/apps/database/migrations/.gitkeep


+ 0 - 0
frameworks/PHP/cygnite-php-framework/apps/extensions/.gitkeep


+ 0 - 0
frameworks/PHP/cygnite-php-framework/apps/languages/english/.gitkeep


+ 25 - 0
frameworks/PHP/cygnite-php-framework/apps/models/Fortune.php

@@ -0,0 +1,25 @@
+<?php 
+namespace Apps\Models;
+
+use Cygnite\Database\ActiveRecord;
+
+class Fortune extends ActiveRecord
+{
+    //your database connection name
+    protected $database = 'hello_world';
+
+    /*
+     | By default Every model class name used as table name
+     | "User" => 'user'
+     | You can also override the table name here
+     */
+    //protected $tableName = 'users';
+
+    protected $primaryKey = 'id';
+    //public $perPage = 5;
+
+    public function __construct()
+    {
+        parent::__construct();
+    }
+}// End of the User Model

+ 24 - 0
frameworks/PHP/cygnite-php-framework/apps/models/World.php

@@ -0,0 +1,24 @@
+<?php 
+namespace Apps\Models;
+
+use Cygnite\Database\ActiveRecord;
+
+class World extends ActiveRecord
+{
+    //your database connection name
+    protected $database = 'hello_world';
+
+    /*
+     | By default Every model class name used as table name
+     | "User" => 'user'
+     | You can also override the table name here
+     */
+    //protected $tableName = 'users';
+
+    protected $primaryKey = 'id';
+
+    public function __construct()
+    {
+        parent::__construct();
+    }
+}// End of the User Model

+ 0 - 0
frameworks/PHP/cygnite-php-framework/apps/modules/admin/Controllers/.gitkeep


+ 0 - 0
frameworks/PHP/cygnite-php-framework/apps/modules/admin/Models/.gitkeep


+ 0 - 0
frameworks/PHP/cygnite-php-framework/apps/modules/admin/Views/.gitkeep


+ 13 - 0
frameworks/PHP/cygnite-php-framework/apps/routerconfig.php

@@ -0,0 +1,13 @@
+<?php
+
+if (!defined('CF_SYSTEM')) {
+    exit('No External script access allowed');
+}
+/**
+ * Direct routing to controller
+ * This file is used to set all routing configurations
+ */
+return array(
+    '/sayhello/{:name}' => 'user.welcome',
+    //'/blog(/{:year}(/{:month}(/{:day}?)?)?)?' => 'home.category'
+);

+ 56 - 0
frameworks/PHP/cygnite-php-framework/apps/routes.php

@@ -0,0 +1,56 @@
+<?php
+use Cygnite\Foundation\Application;
+use Cygnite\Base\Router\Router;
+
+if (!defined('CF_SYSTEM')) {
+    exit('No External script access allowed');
+}
+
+$app = Application::instance();
+
+// Before Router Middle Ware
+/*$app->router->before('GET', '/{:all}', function ()
+{
+   //echo "This site is under maintenance.";exit;
+});*/
+
+$app->router->get('/json', function ()
+{
+    header('Content-type: application/json');
+    echo json_encode(array('message'=>'Hello, World!'));
+});
+
+$app->router->get('/plaintext', function ()
+{
+    header("Content-Type: text/plain;");
+    echo 'Hello, World!';
+});
+
+// Dynamic route: /fortunes
+/*$app->router->get('/fortunes', function ()
+{
+    Router::call('Bench.fortunes', array());
+});*/
+
+/*
+GET       - resource/           user.getIndex
+GET       - resource/new        user.getNew
+POST      - resource/           user.postCreate
+GET       - resource/{id}       user.getShow
+GET       - resource/{id}/edit  user.getEdit
+PUT|PATCH - resource/{id}       user.putUpdate
+DELETE    - resource/{id}       user.delete
+*/
+//$app->router->resource('resource', 'user'); // respond to resource routing
+
+/**
+ * After routing callback
+ * Will call after executing all user defined routing.
+ */
+$app->router->after(function()
+{
+   //echo "After Routing callback";
+});
+
+
+$app->router->run();

+ 0 - 0
frameworks/PHP/cygnite-php-framework/apps/services/Payment/.gitkeep


+ 0 - 0
frameworks/PHP/cygnite-php-framework/apps/temp/cache/.gitkeep


+ 0 - 0
frameworks/PHP/cygnite-php-framework/apps/temp/database/.gitkeep


+ 0 - 0
frameworks/PHP/cygnite-php-framework/apps/temp/logs/.gitkeep


+ 0 - 0
frameworks/PHP/cygnite-php-framework/apps/temp/sessions/.gitkeep


+ 0 - 0
frameworks/PHP/cygnite-php-framework/apps/temp/twig/tmp/cache/.gitkeep


+ 20 - 0
frameworks/PHP/cygnite-php-framework/apps/views/bench/fortunes.view.php

@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head><title>Fortunes</title></head>
+<body>
+<table>
+    <tr>
+        <th>id</th>
+        <th>message</th>
+    </tr>
+    <?php foreach ($fortunes as $key => $fortune) { ?>
+    <tr>
+        <td><?php echo $fortune->id; ?></td>
+        <td><?php echo htmlentities($fortune->message, ENT_QUOTES, 'UTF-8', false); ?></td>
+
+    </tr>
+    <?php } ?>
+
+</table>
+</body>
+</html>

+ 124 - 0
frameworks/PHP/cygnite-php-framework/apps/views/home/welcome.view.php

@@ -0,0 +1,124 @@
+<?php
+use Cygnite\AssetManager\Asset;
+use Cygnite\Common\UrlManager\Url;
+?>
+
+    <div class="header">
+        <div style="padding: 5px; ">
+            <div align="center" > <h3 class="text-center"   style="color:#fff !important;">
+                    <strong style="font-weight: bolder; font-size: 40px;"> Welcome </strong> to Cygnite PHP Framework </h3>
+                <span style="font-size: 20px; color: #F6F6F1; ">A modern and elegant toolkit for web developers</span>
+            </div>
+        </div>
+    </div>
+
+    <div class="container-body">
+
+
+            <div align="center">
+                <h2 class="text-center">Why you'll love Cygnite Framework?</h2>
+                <hr class="featurette-divider"></hr>
+            </div>
+            <p class="lead head-subtitle">
+                Cygnite packed with tons of awesome features to make your development very simple and enjoyable.
+                You may be beginner or advance professional, Cygnite does all magic to fit you right in.</p>
+
+            <hr class="featurette-divider"></hr>
+
+
+            <ul class="thumbnails">
+                <li class="span3">
+                    <div class="feature-block">
+                        <div class="features-head">
+                            <h3 class="title">
+                                <a href="http://www.cygniteframework.com/2013/07/introduction.html">Better <span class="title-em">Performance</span></a></h3>
+                        </div>
+                        <p> Cygnite gives exceptional performance because of it's lazy loading mechanism. Cygnite only loads the features that you need. </p>
+                    </div>
+                </li>
+                <li class="span3">
+                    <div class="feature-block">
+                        <div class="features-head">
+                            <h3 class="title">
+                                <a href="http://www.cygniteframework.com/2013/08/controllers.html">User  <span class="title-em">Friendly</span></a></h3>
+                        </div>
+                        <p> No more configuring things. Cygnite comes with out of box configuration. Expressive, beautiful syntax make you to love
+                            code. Composer powered, allow you to plug in third party packages.
+                        </p>
+                    </div>
+                </li>
+
+                <li class="span3">
+                    <div class="feature-block">
+                        <div class="features-head">
+                            <h3 class="title">
+                                <a href="http://www.cygniteframework.com/2013/08/routing.html">RESTful  <span class="title-em">Routing</span></a></h3>
+                        </div>
+                        <p>Cygnite provides a powerful router that response to route callbacks to specific HTTP request methods and URIs. RESTful
+                            resource controllers lead you to build powerful REST api. </p>
+                    </div>
+                </li>
+
+                <li class="span3">
+                    <div class="feature-block">
+                        <div class="features-head">
+                            <h3 class="title">
+                                <a href="http://www.cygniteframework.com/2014/03/ioc-container.html">IoC  <span class="title-em">Container</span></a></h3>
+                        </div>
+                        <p>Stay flexible and build decoupled software using Cygnite IoC. Inject dependencies into the controller without any configuration.</p>
+                    </div>
+                </li>
+
+                <li class="span3">
+                    <div class="feature-block">
+                        <div class="features-head">
+                            <h3 class="title">
+                                <a href="http://www.cygniteframework.com/2013/08/active-record.html">Active <span class="title-em">Record</span></a></h3>
+                        </div>
+                        <p> Cygnite provide simple and amazing ActiveRecord implementation for working with  database. Each model class interact with database table. </p>
+                    </div>
+                </li>
+
+                <li class="span3">
+                    <div class="feature-block">
+                        <div class="features-head">
+                            <h3 class="title">
+                                <a href="http://www.cygniteframework.com/2014/03/console-overview.html"> Cygnite <span class="title-em">CLI</span></a></h3>
+                        </div>
+                        <p> Don't want to spend more time? Cygnite provide you powerful CLI tool to reduce pain.
+                            You create database, Cygnite will generate php code for you. Migration allow you to build database version
+                            control with ease.  </p>
+                    </div>
+                </li>
+            </ul>
+
+
+    </div>
+    <div class="clear"> </div>
+    <hr class="featurette-divider">
+
+    <div class="footer" >
+        <div class="footer-inner-left"> </div>
+        <div class="footer-inner" align="center">
+            <div class="footerrow tweets"  >
+                <p style="font-size: 16px;">If you are exploring Cygnite Framework for first time,
+                    you should read beautiful <a href="http://www.cygniteframework.com/2013/07/quickstart.html">User Guide</a> </p>
+                <p style="font-size: 18px;">You will love the simplicity of Cygnite Framework</p>
+            </div>
+
+            <div class="footerrow" align="center" style="clear:both;padding-top: 0px;">
+                <div class="footer-hr"></div>
+
+                <?php echo \Cygnite\Foundation\Application::poweredBy(); ?>
+            </div>
+        </div>
+        <div class="footer-inner-right"> </div>
+        <div class="clear"> </div>
+    </div>
+
+<?php echo Asset::style('assets/css/cygnite/style.css'); ?>
+
+<style type="text/css">
+    .feature-block{ float: left;border:0px; font-size: 17px;font-family: small-caption;}
+    .title {padding-top: 10px;}
+</style>

+ 81 - 0
frameworks/PHP/cygnite-php-framework/apps/views/layout/home.view.php

@@ -0,0 +1,81 @@
+<?php
+use Cygnite\Mvc\View\Widget;
+use Cygnite\AssetManager\AssetCollection;
+use Cygnite\Common\UrlManager\Url;
+
+$asset = AssetCollection::make(function ($asset)
+    {
+        // group of stylesheets
+        $asset->add('style', array('path' => 'assets/css/bootstrap/css/bootstrap.min.css'))
+            ->add('style', array('path' => 'assets/css/bootstrap/css/bootstrap-theme.min.css'))
+            ->add('style', array('path' => 'assets/css/cygnite/bootstrap/datatables-bootstrap.css'))
+            ->add('style', array('path' => 'assets/css/cygnite/flash.css'))
+            ->add('style', array('path' => 'assets/css/cygnite/wysihtml5/prettify.css'))
+            ->add('style', array('path' => 'assets/css/cygnite/wysihtml5/bootstrap-wysihtml5.css'));
+
+        // Group of scripts
+        $asset->add('script', array('path' => 'assets/js/cygnite/jquery/1.10.1/jquery.min.js'))
+            ->add('script', array('path' => 'assets/js/twitter/bootstrap/js/bootstrap.min.js'))
+            ->add('script', array('path' => 'assets/js/dataTables/jquery.dataTables.min.js'))
+            ->add('script', array('path' => 'assets/js/dataTables/datatables-bootstrap.js'))
+            ->add('script', array('path' => 'assets/js/dataTables/datatables.fnReloadAjax.js'))
+            ->add('script', array('path' => 'assets/js/dataTables/prettify.js'));
+
+        return $asset;
+    });
+?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+
+    <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <link rel="shortcut icon" href="<?php echo Url::getBase(); ?>assets/img/cygnite/fevicon.png" > </link>
+
+    <title><?php echo $this->title; ?></title>
+    <meta name="keywords" content="CRUD Application" />
+    <meta name="author" content="Cygnite Framework Bootstrap Starter Site." />
+    <!-- Google will often use this as its description of your page/site. Make it good. -->
+    <meta name="description" content="Cygnite CRUD Generator." />
+    <!--  Mobile Viewport Fix -->
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
+
+    <?php $asset->dump('style');// Header Style block ?>
+    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
+    <!--[if lt IE 9]>
+    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+</head>
+<body>
+
+<!-- Fluid Container -->
+<div class='container'>
+
+    <!-- Content -->
+    <?php echo $yield; ?>
+    <!-- ./ Content -->
+
+    <!-- Footer -->
+    <footer class="clearfix"></footer>
+    <!-- ./ Footer -->
+
+</div>
+<!-- ./ Container End -->
+<?php
+//Script block. Scripts will render here
+$asset->dump('script');
+?>
+
+<script type="text/javascript">
+    $(function () {
+        $('#dataGrid').DataTable();
+    });
+</script>
+
+<style type="text/css">
+    .navbar-inverse {background: none repeat scroll 0 0 #07508f!important;}
+</style>
+
+</body>
+</html>

+ 0 - 0
frameworks/PHP/cygnite-php-framework/assets/css/.gitkeep


+ 0 - 0
frameworks/PHP/cygnite-php-framework/assets/img/.gitkeep


BIN
frameworks/PHP/cygnite-php-framework/assets/img/cygnite/favicon.ico


BIN
frameworks/PHP/cygnite-php-framework/assets/img/cygnite/fevicon.png


+ 0 - 0
frameworks/PHP/cygnite-php-framework/assets/js/.gitkeep


+ 44 - 0
frameworks/PHP/cygnite-php-framework/benchmark_config.json

@@ -0,0 +1,44 @@
+{
+  "framework": "cygnite-php-framework",
+  "tests": [{
+    "default": {
+      "setup_file": "setup",
+      "json_url": "/index.php/json",
+      "plaintext_url": "/index.php/plaintext",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Fullstack",
+      "database": "None",
+      "framework": "cygnite",
+      "language": "PHP",
+      "orm": "Raw",
+      "platform": "PHP-FPM",
+      "webserver": "nginx",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "cygnite",
+      "notes": "",
+      "versus": "php"
+    },
+    "raw": {
+      "setup_file": "setup",
+      "db_url": "/index.php/bench/db",
+      "query_url": "/index.php/bench/queries/",
+      "fortune_url": "/index.php/bench/fortunes",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Fullstack",
+      "database": "MySQL",
+      "framework": "cygnite",
+      "language": "PHP",
+      "orm": "Raw",
+      "platform": "PHP-FPM",
+      "webserver": "nginx",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "cygnite",
+      "notes": "",
+      "versus": "php"
+    }
+  }]
+}

+ 61 - 0
frameworks/PHP/cygnite-php-framework/boot/initialize.php

@@ -0,0 +1,61 @@
+<?php
+/*
+ |-------------------------------------------------------------------
+ | Register Composer PSR Auto Loader
+ |-------------------------------------------------------------------
+ |
+ | Composer is the convenient way to auto load all dependencies and
+ | classes. We will simple require it here, so that we don't need
+ | worry about importing classes manually.
+ */
+require __DIR__ . "/../vendor/autoload.php";
+
+/*
+| -------------------------------------------------------------------
+| Check if script is running via cli and return false
+| -------------------------------------------------------------------
+*/
+$filename = preg_replace('#(\?.*)$#', '', $_SERVER['REQUEST_URI']);
+
+if (php_sapi_name() === 'cli-server' && is_file($filename)) {
+    return false;
+}
+
+/*
+|--------------------------------------------------------------------------
+| Create The Application
+|--------------------------------------------------------------------------
+|
+| To boot framework first thing we will create a new application instance
+| which serves glue for all the components, and binding components
+| with the IoC container
+*/
+$app = \Cygnite\Foundation\Application::instance();
+
+$app->importHelpers();
+/*
+|--------------------------------------------------------------------------
+| Attach Exception handler to Event Listener
+|--------------------------------------------------------------------------
+|
+| We will attach exception handler to event listener, so that if anything
+| goes wrong it will catch exceptions.
+*/
+$app['app.event'] = function () use($app) {
+
+    $event = $app->singleton('event', '\Cygnite\Base\EventHandler\Event');
+    $event->attach("exception", '\\Cygnite\\Exception\\Handler@handleException');
+
+    return $event;
+};
+
+$config = \Cygnite\Helpers\Config::load();
+
+/**
+ | ---------------------------------------------------
+ | Application booting process
+ | --------------------------------------------------
+ *
+ * Set configuration and services and boot-up application
+ */
+return $app->setConfiguration($config)->boot();

+ 39 - 0
frameworks/PHP/cygnite-php-framework/boot/start.php

@@ -0,0 +1,39 @@
+<?php
+
+/*
+| -------------------------------------------------------------
+| Check PHP Version
+| -------------------------------------------------------------
+| Check minimum version requirement of Cygnite
+| and trigger exception is not satisfied
+|
+*/
+if (version_compare(PHP_VERSION, '5.3', '<') === true) {
+    @set_magic_quotes_runtime(0); // Kill magic quotes
+    die('Require PHP v5.3.8 or More! \n');
+}
+
+/*
+|--------------------------------------------------------------------------
+| Check Extensions
+|--------------------------------------------------------------------------
+|
+| Cygnite requires a few extensions to function. We will check if
+| extensions loaded. If not we'll just exit from here.
+|
+*/
+if ( ! extension_loaded('mcrypt')) {
+    echo 'Cygnite requires Mcrypt PHP extension.'.PHP_EOL;
+    exit(1);
+}
+
+require 'initialize'.EXT;
+
+/*
+|--------------------------------------------------------------------------
+| Bootstrap process
+|--------------------------------------------------------------------------
+|
+| Booting process is done lets start the application
+*/
+return $app->run();

+ 27 - 0
frameworks/PHP/cygnite-php-framework/composer.json

@@ -0,0 +1,27 @@
+{
+    "name": "cygnite/cygnite-application",
+    "description": "Cygnite PHP Framework- Skeleton Application",
+    "keywords": ["Cygnite", "Framework"],
+    "homepage": "http://www.cygniteframework.com",
+    "license": "MIT",
+    "authors": [
+        {
+            "name": "Sanjoy Dey",
+            "email": "[email protected]"
+        }
+    ],
+    "require": {
+        "cygnite/framework": "dev-master"
+    },
+    "autoload": {
+        "classmap": [
+            "apps/controllers",
+            "apps/models",
+            "apps/components" ,
+            "apps/extensions"
+        ]
+    },
+    "config": {
+        "preferred-install": "dist"
+    }
+}

+ 9 - 0
frameworks/PHP/cygnite-php-framework/deploy/cygnite-php-framework

@@ -0,0 +1,9 @@
+<VirtualHost *:8080>
+  Alias /cygnite-php-framework/ "/home/ubuntu/FrameworkBenchmarks/cygnite-php-framework/"
+  <Directory /home/ubuntu/FrameworkBenchmarks/cygnite-php-framework>
+          Options Indexes FollowSymLinks MultiViews
+          #AllowOverride None
+          Order allow,deny
+          allow from all
+  </Directory>
+</VirtualHost>

+ 133 - 0
frameworks/PHP/cygnite-php-framework/deploy/nginx.conf

@@ -0,0 +1,133 @@
+#user  nobody;
+worker_processes  8;
+
+#error_log  logs/error.log;
+#error_log  logs/error.log  notice;
+#error_log  logs/error.log  info;
+error_log stderr error;
+
+#pid        logs/nginx.pid;
+
+
+events {
+    worker_connections  1024;
+}
+
+
+http {
+    include       /usr/local/nginx/conf/mime.types;
+    default_type  application/octet-stream;
+
+    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
+    #                  '$status $body_bytes_sent "$http_referer" '
+    #                  '"$http_user_agent" "$http_x_forwarded_for"';
+
+    #access_log  logs/access.log  main;
+    access_log off;
+
+    sendfile        on;
+    #tcp_nopush     on;
+
+    #keepalive_timeout  0;
+    keepalive_timeout  65;
+
+    #gzip  on;
+    
+    upstream fastcgi_backend {
+        server 127.0.0.1:9001;
+        keepalive 32;
+    }
+
+    server {
+        listen       8080;
+        server_name  localhost;
+
+        #charset koi8-r;
+
+        #access_log  logs/host.access.log  main;
+
+        #location / {
+        #    root   html;
+        #    index  index.html index.htm;
+        #}
+
+        #error_page  404              /404.html;
+
+        # redirect server error pages to the static page /50x.html
+        #
+        #error_page   500 502 503 504  /50x.html;
+        #location = /50x.html {
+        #    root   html;
+        #}
+
+        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
+        #
+        #location ~ \.php$ {
+        #    proxy_pass   http://127.0.0.1;
+        #}
+
+        root /home/ubuntu/FrameworkBenchmarks/cygnite-php-framework/;
+        index  index.php;
+
+        location / {
+            try_files $uri $uri/ /index.php?$uri&$args;
+        }
+
+        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
+        #
+        location ~ \.php$ {
+            try_files $uri =404;
+            fastcgi_pass   fastcgi_backend;
+            fastcgi_index  index.php;
+#            fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
+            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
+            fastcgi_keep_conn on;
+            include        /usr/local/nginx/conf/fastcgi_params;
+        }
+
+        # deny access to .htaccess files, if Apache's document root
+        # concurs with nginx's one
+        #
+        #location ~ /\.ht {
+        #    deny  all;
+        #}
+    }
+
+
+    # another virtual host using mix of IP-, name-, and port-based configuration
+    #
+    #server {
+    #    listen       8000;
+    #    listen       somename:8080;
+    #    server_name  somename  alias  another.alias;
+
+    #    location / {
+    #        root   html;
+    #        index  index.html index.htm;
+    #    }
+    #}
+
+
+    # HTTPS server
+    #
+    #server {
+    #    listen       443;
+    #    server_name  localhost;
+
+    #    ssl                  on;
+    #    ssl_certificate      cert.pem;
+    #    ssl_certificate_key  cert.key;
+
+    #    ssl_session_timeout  5m;
+
+    #    ssl_protocols  SSLv2 SSLv3 TLSv1;
+    #    ssl_ciphers  HIGH:!aNULL:!MD5;
+    #    ssl_prefer_server_ciphers   on;
+
+    #    location / {
+    #        root   html;
+    #        index  index.html index.htm;
+    #    }
+    #}
+
+}

+ 60 - 0
frameworks/PHP/cygnite-php-framework/index.php

@@ -0,0 +1,60 @@
+<?php
+/*
+ * This file is part of the Cygnite package.
+ *
+ * (c) Sanjoy Dey <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+/*
+ * This index file is entry point of the framework,
+ * We will define the paths here to start bootstraping
+ *
+ * @author Sanjoy Dey <[email protected]>
+ */
+
+/*
+ | ---------------------------------------------------------------
+ | Define Directory Separator
+ * ---------------------------------------------------------------
+ */
+define('DS', DIRECTORY_SEPARATOR);
+
+/**
+|---------------------------------------------------------------
+| Define PHP file extension
+| ---------------------------------------------------------------
+*/
+defined('EXT') or define('EXT', '.php');
+
+/*---------------------------------------------------------------
+| Now that we know the path, set the main path constants
+| path to the packages folder.
+| ---------------------------------------------------------------
+*/
+defined('CF_SYSTEM') or define('CF_SYSTEM', 'cygnite-package');
+
+defined('CF_BOOTSTRAP') or define('CF_BOOTSTRAP', 'boot');
+
+/* --------------------------------------------------------------
+| Define application folder name
+| ---------------------------------------------------------------
+*/
+defined('APPPATH') or define('APPPATH', 'apps');
+//chdir(dirname(__DIR__));
+
+/* --------------------------------------------------------------
+| Define `root` directory name
+| ---------------------------------------------------------------
+*/
+$dir = explode(DS, dirname(__FILE__));
+defined('ROOTDIR') or define('ROOTDIR', rtrim(end($dir)));
+defined('CYGNITE_BASE') or define('CYGNITE_BASE', dirname(__FILE__));
+
+/* ---------------------------------------------------------------
+| We have defined path, lets start booting by including start.php
+| ----------------------------------------------------------------
+*/
+require_once CF_BOOTSTRAP.DS.'start'.EXT;

+ 12 - 0
frameworks/PHP/cygnite-php-framework/install.sh

@@ -0,0 +1,12 @@
+#!/bin/bash
+
+export PHP_HOME=${IROOT}/php-5.5.17
+export COMPOSER_HOME=${IROOT}/php-composer
+export PHP_FPM=$PHP_HOME/sbin/php-fpm
+export NGINX_HOME=${IROOT}/nginx
+
+fw_depends php nginx composer
+
+${PHP_HOME}/bin/php ${COMPOSER_HOME}/composer.phar install \
+--no-interaction --working-dir $TROOT \
+--no-progress --optimize-autoloader

+ 15 - 0
frameworks/PHP/cygnite-php-framework/setup.sh

@@ -0,0 +1,15 @@
+#!/bin/bash
+
+export PHP_HOME=${IROOT}/php-5.5.17
+export COMPOSER_HOME=${IROOT}/php-composer
+export PHP_FPM=${PHP_HOME}/sbin/php-fpm
+export NGINX_HOME=${IROOT}/nginx
+
+sed -i 's|127.0.0.1|'"${DBHOST}"'|g' apps/configs/database.php
+sed -i 's|root .*/FrameworkBenchmarks/cygnite-php-framework|root '"${TROOT}"'|g' deploy/nginx.conf
+sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' deploy/nginx.conf
+
+export PATH="${PHP_HOME}/bin:${PHP_HOME}/sbin:$PATH"
+
+$PHP_FPM --fpm-config ${FWROOT}/config/php-fpm.conf -g ${TROOT}/deploy/php-fpm.pid
+${NGINX_HOME}/sbin/nginx -c ${TROOT}/deploy/nginx.conf