diff --git a/.travis.yml b/.travis.yml index 5aea8f5..9caafed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,12 +16,12 @@ before_script: - echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH" - sudo echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config - ssh-keyscan -H -t rsa,dsa github.com >> ~/.ssh/known_hosts - - sudo git clone -b BRANCH https://github.com/astroanu/collejo-tests.git tests + - sudo git clone -b $BRANCH https://github.com/astroanu/collejo-tests.git tests - sudo git rev-parse HEAD - sudo cp tests/phpunit.xml.sample phpunit.xml - sudo cp tests/env.travis.sample .env - rm -R database - - sudo git clone -b BRANCH https://github.com/astroanu/collejo-db-fatories.git database + - sudo git clone -b $BRANCH https://github.com/astroanu/collejo-db-fatories.git database - sudo git rev-parse HEAD - sudo chmod -R 755 database - composer install diff --git a/bootstrap/app.php b/bootstrap/app.php index 775bbd6..ccd5854 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -1,7 +1,7 @@ singleton( diff --git a/config/app.php b/config/app.php index e8b9a5a..4ebd707 100644 --- a/config/app.php +++ b/config/app.php @@ -122,7 +122,7 @@ */ 'providers' => [ - + ], /* @@ -138,7 +138,6 @@ 'aliases' => [ - ], ]; diff --git a/config/auth.php b/config/auth.php index 5e893fc..b9ce42a 100644 --- a/config/auth.php +++ b/config/auth.php @@ -14,7 +14,7 @@ */ 'defaults' => [ - 'guard' => 'web', + 'guard' => 'web', 'passwords' => 'users', ], @@ -37,12 +37,12 @@ 'guards' => [ 'web' => [ - 'driver' => 'session', + 'driver' => 'session', 'provider' => 'users', ], 'api' => [ - 'driver' => 'token', + 'driver' => 'token', 'provider' => 'users', ], ], @@ -67,7 +67,7 @@ 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => Collejo\App\Models\User::class, + 'model' => Collejo\App\Models\User::class, ], // 'users' => [ @@ -98,9 +98,9 @@ 'passwords' => [ 'users' => [ 'provider' => 'users', - 'email' => 'auth.emails.password', - 'table' => 'password_resets', - 'expire' => 60, + 'email' => 'auth.emails.password', + 'table' => 'password_resets', + 'expire' => 60, ], ], diff --git a/config/broadcasting.php b/config/broadcasting.php index abaaac3..6207fd4 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -29,17 +29,17 @@ 'connections' => [ 'pusher' => [ - 'driver' => 'pusher', - 'key' => env('PUSHER_KEY'), - 'secret' => env('PUSHER_SECRET'), - 'app_id' => env('PUSHER_APP_ID'), + 'driver' => 'pusher', + 'key' => env('PUSHER_KEY'), + 'secret' => env('PUSHER_SECRET'), + 'app_id' => env('PUSHER_APP_ID'), 'options' => [ // ], ], 'redis' => [ - 'driver' => 'redis', + 'driver' => 'redis', 'connection' => 'default', ], diff --git a/config/cache.php b/config/cache.php index aaad320..76dbabf 100644 --- a/config/cache.php +++ b/config/cache.php @@ -37,29 +37,29 @@ ], 'database' => [ - 'driver' => 'database', - 'table' => 'cache', + 'driver' => 'database', + 'table' => 'cache', 'connection' => null, ], 'file' => [ 'driver' => 'file', - 'path' => storage_path('framework/cache'), + 'path' => storage_path('framework/cache'), ], 'memcached' => [ - 'driver' => 'memcached', + 'driver' => 'memcached', 'servers' => [ [ - 'host' => env('MEMCACHED_HOST', '127.0.0.1'), - 'port' => env('MEMCACHED_PORT', 11211), + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), 'weight' => 100, ], ], ], 'redis' => [ - 'driver' => 'redis', + 'driver' => 'redis', 'connection' => 'default', ], diff --git a/config/clockwork.php b/config/clockwork.php index fdaf2ec..4f79bea 100644 --- a/config/clockwork.php +++ b/config/clockwork.php @@ -2,135 +2,135 @@ return [ - /* - |-------------------------------------------------------------------------- - | Enable Clockwork - |-------------------------------------------------------------------------- - | - | You can explicitly enable or disable Clockwork here. When enabled, special - | headers for communication with the Clockwork Chrome extension will be - | included in your application responses and requests data will be available - | at /__clockwork url. - | When set to null, Clockwork behavior is controlled by app.debug setting. - | Default: null - | - */ - - 'enable' => null, - - /* - |-------------------------------------------------------------------------- - | Enable data collection, when Clockwork is disabled - |-------------------------------------------------------------------------- - | - | This setting controls, whether data about application requests will be - | recorded even when Clockwork is disabled (useful for later analysis). - | Default: false - | - */ - - 'collect_data_always' => false, - - /* - |-------------------------------------------------------------------------- - | Metadata storage - |-------------------------------------------------------------------------- - | - | You can configure how are the metadata collected by Clockwork stored. - | Valid options are: files or sql. - | Files storage stores the metadata in one-per-request files in a specified - | directory. - | Sql storage stores the metadata as rows in a sql database. You can specify - | the database by name if defined in database.php or by path to Sqlite - | database. Database table will be automatically created. - | Sql storage requires PDO. - | - */ - - 'storage' => 'files', - - 'storage_files_path' => storage_path('clockwork'), - - 'storage_sql_database' => storage_path('clockwork.sqlite'), - 'storage_sql_table' => 'clockwork', - - /* - |-------------------------------------------------------------------------- - | Filter collected data - |-------------------------------------------------------------------------- - | - | You can filter collected data by specifying what you don't want to collect - | here. - | - */ - - 'filter' => [ - 'routes', // collecting routes data on every request might use a lot of disk space - 'viewsData', // collecting views data, including all variables passed to the view on every request might use a lot of disk space - ], - - /* - |-------------------------------------------------------------------------- - | Disable data collection for certain URIs - |-------------------------------------------------------------------------- - | - | You can disable data collection for specific URIs by adding matching - | regular expressions here. - | - */ - - 'filter_uris' => [ - '/__clockwork/.*', // disable collecting data for clockwork-web assets - ], - - /* - |-------------------------------------------------------------------------- - | Additional data sources - |-------------------------------------------------------------------------- - | - | You can use this option to register additional data sources with Clockwork. - | Keys specify the name under which the data source will be registered in the - | IoC container, values are closures accepting Laravel application instance as - | the only argument and returning an instance of the data source. - | - */ - - 'additional_data_sources' => [ - // Note, this is for example only, laravel-doctrine contains Clockwork support out of the box, please follow the - // documentation at http://www.laraveldoctrine.org/docs/current/orm/config-file - - // 'clockwork.doctrine' => function($app) - // { - // return new \Clockwork\DataSource\DoctrineDataSource($app['Doctrine\ORM\EntityManager']); - // } - ], - - /* - |-------------------------------------------------------------------------- - | Register helpers - |-------------------------------------------------------------------------- - | - | This setting controls whether the "clock" helper function will be registered. You can use the "clock" function to - | quickly log something to Clockwork or access the Clockwork instance. - | - */ - - 'register_helpers' => true, - - /* - |-------------------------------------------------------------------------- - | Send Headers for AJAX request - |-------------------------------------------------------------------------- - | - | When trying to collect data the AJAX method can sometimes fail if it is - | missing required headers. For example, an API might require a version - | number using Accept headers to route the HTTP request to the correct - | codebase. - | - */ - - 'headers' => [ - // 'Accept' => 'application/vnd.com.whatever.v1+json', - ] + /* + |-------------------------------------------------------------------------- + | Enable Clockwork + |-------------------------------------------------------------------------- + | + | You can explicitly enable or disable Clockwork here. When enabled, special + | headers for communication with the Clockwork Chrome extension will be + | included in your application responses and requests data will be available + | at /__clockwork url. + | When set to null, Clockwork behavior is controlled by app.debug setting. + | Default: null + | + */ + + 'enable' => null, + + /* + |-------------------------------------------------------------------------- + | Enable data collection, when Clockwork is disabled + |-------------------------------------------------------------------------- + | + | This setting controls, whether data about application requests will be + | recorded even when Clockwork is disabled (useful for later analysis). + | Default: false + | + */ + + 'collect_data_always' => false, + + /* + |-------------------------------------------------------------------------- + | Metadata storage + |-------------------------------------------------------------------------- + | + | You can configure how are the metadata collected by Clockwork stored. + | Valid options are: files or sql. + | Files storage stores the metadata in one-per-request files in a specified + | directory. + | Sql storage stores the metadata as rows in a sql database. You can specify + | the database by name if defined in database.php or by path to Sqlite + | database. Database table will be automatically created. + | Sql storage requires PDO. + | + */ + + 'storage' => 'files', + + 'storage_files_path' => storage_path('clockwork'), + + 'storage_sql_database' => storage_path('clockwork.sqlite'), + 'storage_sql_table' => 'clockwork', + + /* + |-------------------------------------------------------------------------- + | Filter collected data + |-------------------------------------------------------------------------- + | + | You can filter collected data by specifying what you don't want to collect + | here. + | + */ + + 'filter' => [ + 'routes', // collecting routes data on every request might use a lot of disk space + 'viewsData', // collecting views data, including all variables passed to the view on every request might use a lot of disk space + ], + + /* + |-------------------------------------------------------------------------- + | Disable data collection for certain URIs + |-------------------------------------------------------------------------- + | + | You can disable data collection for specific URIs by adding matching + | regular expressions here. + | + */ + + 'filter_uris' => [ + '/__clockwork/.*', // disable collecting data for clockwork-web assets + ], + + /* + |-------------------------------------------------------------------------- + | Additional data sources + |-------------------------------------------------------------------------- + | + | You can use this option to register additional data sources with Clockwork. + | Keys specify the name under which the data source will be registered in the + | IoC container, values are closures accepting Laravel application instance as + | the only argument and returning an instance of the data source. + | + */ + + 'additional_data_sources' => [ + // Note, this is for example only, laravel-doctrine contains Clockwork support out of the box, please follow the + // documentation at http://www.laraveldoctrine.org/docs/current/orm/config-file + + // 'clockwork.doctrine' => function($app) + // { + // return new \Clockwork\DataSource\DoctrineDataSource($app['Doctrine\ORM\EntityManager']); + // } + ], + + /* + |-------------------------------------------------------------------------- + | Register helpers + |-------------------------------------------------------------------------- + | + | This setting controls whether the "clock" helper function will be registered. You can use the "clock" function to + | quickly log something to Clockwork or access the Clockwork instance. + | + */ + + 'register_helpers' => true, + + /* + |-------------------------------------------------------------------------- + | Send Headers for AJAX request + |-------------------------------------------------------------------------- + | + | When trying to collect data the AJAX method can sometimes fail if it is + | missing required headers. For example, an API might require a version + | number using Accept headers to route the HTTP request to the correct + | codebase. + | + */ + + 'headers' => [ + // 'Accept' => 'application/vnd.com.whatever.v1+json', + ], ]; diff --git a/config/collejo.php b/config/collejo.php index dad3dce..544e441 100644 --- a/config/collejo.php +++ b/config/collejo.php @@ -2,42 +2,42 @@ return [ - // authentication settings - 'auth' => [ - // living time of a re-authentication grant - 'reauth_ttl' => 3600 - ], - - // send emails on - 'emails' => [ - 'new_user_password_create_request' => [ - 'student' => true, - 'guardian' => true, - 'admin' => true, - 'employee' => true - ] - ], - - // global pagination configuration - 'pagination' => [ - 'perpage' => 10 - ], - - // app caching - 'caching' => [ - // cache each user's permissions - 'user_permissions' => 30, - // cache repository search criteria results. relationship are not cached - 'search_criteria' => 30 - ], - - // assets - 'assets' => [ - // load minified version of css and js - 'minified' => true, - - // load additional styles from - 'theme' => null - ], - -]; \ No newline at end of file + // authentication settings + 'auth' => [ + // living time of a re-authentication grant + 'reauth_ttl' => 3600, + ], + + // send emails on + 'emails' => [ + 'new_user_password_create_request' => [ + 'student' => true, + 'guardian' => true, + 'admin' => true, + 'employee' => true, + ], + ], + + // global pagination configuration + 'pagination' => [ + 'perpage' => 10, + ], + + // app caching + 'caching' => [ + // cache each user's permissions + 'user_permissions' => 30, + // cache repository search criteria results. relationship are not cached + 'search_criteria' => 30, + ], + + // assets + 'assets' => [ + // load minified version of css and js + 'minified' => true, + + // load additional styles from + 'theme' => null, + ], + +]; diff --git a/config/database.php b/config/database.php index 8451a62..72216e8 100644 --- a/config/database.php +++ b/config/database.php @@ -47,35 +47,35 @@ 'connections' => [ 'sqlite' => [ - 'driver' => 'sqlite', + 'driver' => 'sqlite', 'database' => env('DB_DATABASE', database_path('database.sqlite')), - 'prefix' => '', + 'prefix' => '', ], 'mysql' => [ - 'driver' => 'mysql', - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', '3306'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', + 'driver' => 'mysql', + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', - 'prefix' => '', - 'strict' => false, - 'engine' => null, + 'prefix' => '', + 'strict' => false, + 'engine' => null, ], 'pgsql' => [ - 'driver' => 'pgsql', - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', '5432'), + 'driver' => 'pgsql', + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '5432'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', - 'schema' => 'public', + 'charset' => 'utf8', + 'prefix' => '', + 'schema' => 'public', ], ], @@ -109,9 +109,9 @@ 'cluster' => false, 'default' => [ - 'host' => env('REDIS_HOST', 'localhost'), + 'host' => env('REDIS_HOST', 'localhost'), 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', 6379), + 'port' => env('REDIS_PORT', 6379), 'database' => 0, ], diff --git a/config/filesystems.php b/config/filesystems.php index 75b5002..7d0d0ed 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -45,18 +45,18 @@ 'local' => [ 'driver' => 'local', - 'root' => storage_path('app'), + 'root' => storage_path('app'), ], 'public' => [ - 'driver' => 'local', - 'root' => storage_path('app/public'), + 'driver' => 'local', + 'root' => storage_path('app/public'), 'visibility' => 'public', ], 's3' => [ 'driver' => 's3', - 'key' => 'your-key', + 'key' => 'your-key', 'secret' => 'your-secret', 'region' => 'your-region', 'bucket' => 'your-bucket', diff --git a/config/image.php b/config/image.php index 6e47738..c636b86 100644 --- a/config/image.php +++ b/config/image.php @@ -1,6 +1,6 @@ 'gd' + 'driver' => 'gd', -); +]; diff --git a/config/queue.php b/config/queue.php index d0f732a..9d61b73 100644 --- a/config/queue.php +++ b/config/queue.php @@ -36,32 +36,32 @@ 'database' => [ 'driver' => 'database', - 'table' => 'jobs', - 'queue' => 'default', + 'table' => 'jobs', + 'queue' => 'default', 'expire' => 60, ], 'beanstalkd' => [ 'driver' => 'beanstalkd', - 'host' => 'localhost', - 'queue' => 'default', - 'ttr' => 60, + 'host' => 'localhost', + 'queue' => 'default', + 'ttr' => 60, ], 'sqs' => [ 'driver' => 'sqs', - 'key' => 'your-public-key', + 'key' => 'your-public-key', 'secret' => 'your-secret-key', 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id', - 'queue' => 'your-queue-name', + 'queue' => 'your-queue-name', 'region' => 'us-east-1', ], 'redis' => [ - 'driver' => 'redis', + 'driver' => 'redis', 'connection' => 'default', - 'queue' => 'default', - 'expire' => 60, + 'queue' => 'default', + 'expire' => 60, ], ], @@ -79,7 +79,7 @@ 'failed' => [ 'database' => env('DB_CONNECTION', 'mysql'), - 'table' => 'failed_jobs', + 'table' => 'failed_jobs', ], ]; diff --git a/config/services.php b/config/services.php index 1731d7b..aaa5e6d 100644 --- a/config/services.php +++ b/config/services.php @@ -20,7 +20,7 @@ ], 'ses' => [ - 'key' => env('SES_KEY'), + 'key' => env('SES_KEY'), 'secret' => env('SES_SECRET'), 'region' => 'us-east-1', ], @@ -30,8 +30,8 @@ ], 'stripe' => [ - 'model' => Collejo\Models\User::class, - 'key' => env('STRIPE_KEY'), + 'model' => Collejo\Models\User::class, + 'key' => env('STRIPE_KEY'), 'secret' => env('STRIPE_SECRET'), ], diff --git a/config/uploader.php b/config/uploader.php index f6e7745..498dc75 100644 --- a/config/uploader.php +++ b/config/uploader.php @@ -7,47 +7,47 @@ | Image Uploader |-------------------------------------------------------------------------- | - | When uploading image Collejo will use the following pre-defined folders. - | disk - name of the disk as defined in filesystems.php - | path = subfolder path in the disk - | permission - user permissions required to upload files - | mime_types - valid mime types - | max_size - allowed max file size - | resize - image files will be automatically resized to the given width and height. + | When uploading image Collejo will use the following pre-defined folders. + | disk - name of the disk as defined in filesystems.php + | path = subfolder path in the disk + | permission - user permissions required to upload files + | mime_types - valid mime types + | max_size - allowed max file size + | resize - image files will be automatically resized to the given width and height. | */ - 'student_pictures' => [ - 'disk' => 'local', - 'path' => '/student_pictures', - 'permissions' => ['edit_student'], - 'mime_types' => ['image/jpeg', 'image/png'], - 'max_size' => 1000, - 'resize' => [ - 'small' => [200, 200], - 'medium' => [600, 600] - ] - ], - 'employee_pictures' => [ - 'disk' => 'local', - 'path' => '/employee_pictures', - 'permissions' => ['edit_employee'], - 'mime_types' => ['image/jpeg', 'image/png'], - 'max_size' => 1000, - 'resize' => [ - 'small' => [200, 200], - 'medium' => [600, 600] - ] - ], - 'employee_attachments' => [ - 'disk' => 'local', - 'path' => '/employee_attachments', - 'permissions' => ['edit_employee'], - 'mime_types' => ['image/jpeg', 'image/png', 'application/pdf', 'application/msword'], - 'max_size' => 10000, - 'resize' => [ - 'small' => [200, 200], - 'medium' => [600, 600] - ] - ], -]; \ No newline at end of file + 'student_pictures' => [ + 'disk' => 'local', + 'path' => '/student_pictures', + 'permissions' => ['edit_student'], + 'mime_types' => ['image/jpeg', 'image/png'], + 'max_size' => 1000, + 'resize' => [ + 'small' => [200, 200], + 'medium' => [600, 600], + ], + ], + 'employee_pictures' => [ + 'disk' => 'local', + 'path' => '/employee_pictures', + 'permissions' => ['edit_employee'], + 'mime_types' => ['image/jpeg', 'image/png'], + 'max_size' => 1000, + 'resize' => [ + 'small' => [200, 200], + 'medium' => [600, 600], + ], + ], + 'employee_attachments' => [ + 'disk' => 'local', + 'path' => '/employee_attachments', + 'permissions' => ['edit_employee'], + 'mime_types' => ['image/jpeg', 'image/png', 'application/pdf', 'application/msword'], + 'max_size' => 10000, + 'resize' => [ + 'small' => [200, 200], + 'medium' => [600, 600], + ], + ], +]; diff --git a/public/index.php b/public/index.php index 00310fc..480d534 100644 --- a/public/index.php +++ b/public/index.php @@ -1,8 +1,8 @@ make(Collejo\App\Contracts\Http\Kernel::class); diff --git a/server.php b/server.php index f65c7c4..1b4655b 100644 --- a/server.php +++ b/server.php @@ -1,12 +1,10 @@ */ - $uri = urldecode( parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) );