v3knet / module
This package is abandoned and no longer maintained.
No replacement package was suggested.
There is no license information available for the latest version (0.2.0) of this package.
0.2.0
2015-09-27 22:52 UTC
Requires
- php: >=5.5
- bernard/bernard: 1.0.*@dev
- dflydev/doctrine-orm-service-provider: ^2.0.0
- doctrine/cache: ^1.4.1
- doctrine/orm: ^2.5.0
- guzzlehttp/guzzle: ^6.0.2
- jms/serializer: ^1.0
- monolog/monolog: ^1.16.0
- phpdocumentor/reflection-docblock: ^2.0
- psr/log: ^1.0.0
- silex/silex: 2.0.x-dev
- swiftmailer/swiftmailer: ^5.4.1
- symfony/config: ^2.7.0
- symfony/console: ^2.7.0
- symfony/dependency-injection: ^2.7.0
- symfony/form: ^2.7.0
- symfony/security: ^2.7.0
- symfony/security-csrf: ^2.7.0
- symfony/serializer: ^2.7.0
- symfony/translation: ^2.7.0
- symfony/twig-bridge: ^2.7
- symfony/validator: ^2.7.0
- symfony/var-dumper: ^2.7.0
- symfony/yaml: ^2.7.0
- twig/twig: ^1.18
Requires (Dev)
- silex/web-profiler: 2.0.x-dev
- symfony/var-dumper: ^2.7.0
Suggests
- silex/web-profiler: silex/web-profiler 2.0.x-dev
README
Built-ins features
- Twig/Bootstrap/Google analytics/…
- Doctrine Cache, DBAL, ORM
- BernardPHP message queue
- SF2 Console (make your command as service, name it as
anything.command.the_name
, then runphp cli.php
, you see your command is auto registered) - Module system, check
./modules/system
as example. - Swagger UI
Usage
Require atphp/atsilex
in your project's composer.json
file:
{ "name": "v3knet/website", "require": { "atphp/atsilex": "^0.1.0" }, "scripts": { "post-install-cmd": [ "atsilex\\module\\system\\commands\\InstallerScript::execute" ] }, "extra": { "atsilex": { "%site_name%": "My Project", "%site_version%": "1.0-dev", "%site_url%": "http://www.vendor-name.com/", "%site_frontpage%": "hello", "%site_ga_code%": "UA-1234567-890", "%vendor_name%": "Vendor Name" } } }
On composer install atsilex
will setup default structure for for your application:
files/ # Directory to store temporary files (cache, compiled templates, …)
config.default.php # (*) Default
config.php # The file that return configuration for application.
public/ # Document root
/index.php # (*) Front controller
/assets/modules/* # Symlinks for modules's assets
# Don't edit (*), they will be overwritten in next composer install.
Write custom module
A module is basically a class which extends atsilex\module\Module
. Each module can:
Define a module is simple, you also need tell the application about your module —
edit config.php
, include your modules there:
return [ // … 'modules' => [ 'my_module' => 'MyModule', 'system' => 'atsilex\module\system\SystemModule', # Can't disable ], // … ];
Configure database connection
Default database for application is a SQLite file, it's auto created in files/app.db
when we run php public/index.php orm:schema-tool:create
command.
To change default config for database connection, in config.php
, add code similar to this:
# SQlite # $db_options = ['driver' => 'pdo_sqlite', 'path' => '/alternative/path/to/app.db']; # MySQL $db_options = [ 'driver' => 'pdo_mysql', 'host' => 'mysql_write.someplace.tld', 'dbname' => 'my_database', 'user' => 'my_username', 'password' => 'my_password', 'charset' => 'utf8mb4', ]; return [ // … 'db.options' => $db_options, // … ];