Skip to content

Commit

Permalink
Improved installation process
Browse files Browse the repository at this point in the history
  • Loading branch information
rougin committed Jun 21, 2015
1 parent de4ede3 commit 28c24a6
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Slytherin is a simple and extensible PHP library that follows an MVC software ar
},
"scripts": {
"post-install-cmd": [
"Rougin\\Slytherin\\Installer\\Installer::slytherize"
"Rougin\\Slytherin\\Installer::deploy"
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rougin/slytherin",
"description": "A simple and extensible PHP library for creating small projects",
"keywords": ["barebones", "extensible", "library", "mvc"],
"keywords": ["barebones", "extensible", "library", "mvc", "php"],
"require": {
"php": ">=5.3.0",
"corneltek/pux": "~1.5",
Expand Down
14 changes: 7 additions & 7 deletions src/Installer/Installer.php → src/Installer.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php namespace Rougin\Slytherin\Installer;
<?php namespace Rougin\Slytherin;

use Composer\Installer\PackageEvent;
use Composer\Script\Event;
Expand All @@ -16,7 +16,7 @@ class Installer
*
* @return integer
*/
public static function slytherize(Event $event = null)
public static function deploy(Event $event = null)
{
/**
* Creates a series of directories
Expand Down Expand Up @@ -51,7 +51,7 @@ public static function slytherize(Event $event = null)
*/

if ( ! file_exists('app/controllers/Welcome.php')) {
$welcome = file_get_contents(__DIR__ . '/Welcome.txt');
$welcome = file_get_contents(__DIR__ . '/Templates/Welcome.txt');

$file = fopen('app/controllers/Welcome.php', 'wb');
file_put_contents('app/controllers/Welcome.php', $welcome);
Expand Down Expand Up @@ -80,7 +80,7 @@ public static function slytherize(Event $event = null)
* Creates a .htacess for clean urls
*/

$htaccess = file_get_contents(__DIR__ . '/Htaccess.txt');
$htaccess = file_get_contents(__DIR__ . '/Templates/Htaccess.txt');

$file = fopen('.htaccess', 'wb');
chmod('.htaccess', 0777);
Expand All @@ -92,7 +92,7 @@ public static function slytherize(Event $event = null)
*/

if ( ! file_exists('index.php')) {
$index = file_get_contents(__DIR__ . '/Index.txt');
$index = file_get_contents(__DIR__ . '/Templates/Index.txt');

$file = fopen('index.php', 'wb');
chmod('index.php', 0777);
Expand All @@ -105,7 +105,7 @@ public static function slytherize(Event $event = null)
*/

if ( ! file_exists('app/config/databases.php')) {
$database = file_get_contents(__DIR__ . '/Databases.txt');
$database = file_get_contents(__DIR__ . '/Templates/Databases.txt');

$file = fopen('app/config/databases.php', 'wb');
file_put_contents('app/config/databases.php', $database);
Expand All @@ -117,7 +117,7 @@ public static function slytherize(Event $event = null)
*/

if ( ! file_exists('app/config/routes.php')) {
$routes = file_get_contents(__DIR__ . '/Routes.txt');
$routes = file_get_contents(__DIR__ . '/Templates/Routes.txt');

$file = fopen('app/config/routes.php', 'wb');
file_put_contents('app/config/routes.php', $routes);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 28c24a6

Please sign in to comment.