Skip to content

Commit

Permalink
Update the README.md to be more in line with where Parable's at now, …
Browse files Browse the repository at this point in the history
…and fix up the command.
  • Loading branch information
Robin de Graaf committed Jul 2, 2017
1 parent 0fd19ab commit 67887cb
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 57 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Parable PHP Framework Changelog

### 0.11.2

__Changes__
- Fixed up the README.md file, since it was a bit outdated. Also changed the 'feel' of the text to represent the maturing state of Parable.
- Renamed `init` command to `init-parable`, then immediately renamed it `init-structure` and added a check whether a structure was already initialized, adding a warning if it was.

### 0.11.1

Well, that was fast!
Expand Down
70 changes: 17 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,87 +5,51 @@
[![Latest Unstable Version](https://poser.pugx.org/devvoh/parable/v/unstable)](https://packagist.org/packages/devvoh/parable)
[![License](https://poser.pugx.org/devvoh/parable/license)](https://packagist.org/packages/devvoh/parable)

Parable is intended to be a tiny, fast and out-of-your-way PHP framework that just lets you get stuff done. To achieve
this, Parable includes only what is needed to create small to medium-sized web applications, but allows any PSR-4
compatible library to be added easily for extensibility.
Parable is a small and no-nonsense PHP framework, meant to be fast, readable and written in a way where it's not bogging
you down with unnecessary rules and limitations. Developed with the goal of building small web applications and REST APIs.

So why build Parable if there's so many perfectly valid PHP frameworks already out there? Partly to see if I could and
partly because I wanted something small, quick and comfortably to quickly build something on top of.

Parable isn't by any means production-ready, secure or foolproof. So only try it if you feel like filing some bug reports!
Parable has been in pre-release for a long time (and for many versions) but a 1.0.0 release, which will also bring
documentation, is a goal for 2017.

## Requirements

- PHP 5.6, PHP 7.x
- Composer
- Sense of adventure

## Installation

Parable can be installed by using [Composer](http://getcomposer.org/). Simply run:

`composer require devvoh/parable`

You'll get the latest version this way. If you want to install a specific version, include the version (0.8.0, for example).
It is, however, preferred to use the above version notation, since it will also get you updated and fixed versions, but no
backwards-compatibility breaking changes.

After you've run the above command, you'll have a composer.json and a vendor folder. Parable is in there, but it's not
quite ready to be used. To initialize Parable's folder structure and files, run the following command:
After you've run the above command, you'll have a composer.json, composer.lock and a vendor folder. Parable is in there,
but it's not quite ready to be used. To initialize Parable's folder structure and files, run the following command:

`vendor/bin/parable init`
`vendor/bin/parable init-structure`

Now you're ready! Simply open the (properly installed apache2 & php 5.6 or 7.x) url it's in in your browser and you should
see a welcome page.

If you want to use nginx, that's cool too, but you'll have to set up url rewriting rules yourself.
If you want to use nginx or another browser, that's cool too, but you'll have to set up url rewriting rules yourself.

## Getting Started

After you've run `parable init`, you should have a basic structure to work from. The example files show most of what you'll
need to build something, but one thing that might not be clear is how to configure Parable to work with a database.

The following example config shows a connection with a MySQL database:

return [
'app' => [
'title' => 'example',
'version' => '0.1.0',
],
'initLocations' => [
'app/Init',
],
'database' => [
'type' => 'mysql',
'location' => 'localhost',
'username' => 'username',
'password' => 'password',
'database' => 'database',
],
];

Now, if you want to keep this out of your git (or other vcs) repository, you can place this in a separate config
file and exclude it. It's also possible to have the config class return different values based on whether
you're running dev/test/staging/production.
After you've run `parable init-structure`, you should have a basic structure to work from. The example files show most
of what you'll need to build something. The example `\Config\App` file includes some of the most important things
Parable itself will listen to.

For an sqlite3 connection, use `'type' => 'sqlite3'`, where `'location'` corresponds to the location of the database
file on your filesystem.
Now, if you want to keep this out of your git (or other vcs) repository, you can place this in a separate config
file and exclude it using a `.gitignore` file. Parable will attempt to load any Config files located in `app/Config`.

## Documentation & More

Documentation is currently non-existent, but I am more than willing and available to answer any questions. I am also very
open to suggestions and improvements. Parable is what I personally need in a framework, and if it seems to fit what you
need as well 'except for these small things', I would love to hear from you to see if maybe we can't work it in somehow.

## Details
Since the API of Parable was in heavy flux, no documentation has been attempted yet. With the release of 0.11.0, the
API is pretty much set for now, and the documentation writing process will start.

Parable probably won't ever be truly done, but the basis that stands at this point will provide a good platform to build out
from. The intent is to add unit testing, documentation and more as time moves on. For now, it's time for me to start
implementing Parable through projects, to find out where possible issues are left to find. But it's surprisingly
usable as it stands.
## Contact

Any questions or constructive feedback? Find me at [devvoh.com](http://devvoh.com) or ask me a question by adding an
issue on github.
issue on github. I generally respond fairly quickly, since this is a passion project, after all.

## License

Expand Down
2 changes: 1 addition & 1 deletion parable
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $app->setName('Parable');

// Always add Help & Init
$app->addCommand(\Parable\DI\Container::get(\Parable\Console\Command\Help::class));
$app->addCommand(\Parable\DI\Container::get(\Parable\Framework\Command\InitParable::class));
$app->addCommand(\Parable\DI\Container::get(\Parable\Framework\Command\InitStructure::class));

// Attempt to load commands set by the user
if (file_exists($path->getDir('app'))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Parable\Framework\Command;

class InitParable extends \Parable\Console\Command
class InitStructure extends \Parable\Console\Command
{
/** @var string */
protected $name = 'init-parable';
protected $name = 'init-structure';

/** @var string */
protected $description = 'This command initializes a parable structure.';
Expand All @@ -31,9 +31,14 @@ public function run()
"",
"<red>WARNING</red>",
"This will overwrite existing files without notice!",
"",
]);

if (file_exists($this->path->getDir('app')) && file_exists($this->path->getDir('public'))) {
$this->output->writeBlock("Note: It looks like you already have a structure initialized!", "info");
} else {
$this->output->newline();
}

for (;;) {
$this->output->write("Do you want to continue? [y/N] ");
if ($this->input->getYesNo(false)) {
Expand Down

0 comments on commit 67887cb

Please sign in to comment.