Skip to content
This repository has been archived by the owner on Dec 16, 2019. It is now read-only.

Commit

Permalink
Prepare 0.3.1 release for installer
Browse files Browse the repository at this point in the history
  • Loading branch information
skyronic committed Dec 25, 2015
1 parent 29cb265 commit c675717
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 640 deletions.
4 changes: 4 additions & 0 deletions src/CrudKit/CrudKitApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,8 @@ public function setJsonResponse($jsonResponse)
$this->jsonResponse = $jsonResponse;
}

public function __construct () {
session_start();
}

}
6 changes: 6 additions & 0 deletions src/CrudKit/Pages/BasicLoginPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ public function fail ($error) {
$this->error = $error;
}

protected $welcomeMessage = "Please Log In";
public function setWelcomeMessage ($message) {
$this->welcomeMessage = $message;
}

function render()
{
if ($this->loginQueued) {
Expand All @@ -92,6 +97,7 @@ function render()
'data' => [
'staticRoot' => $this->app->getStaticRoot(),
'title' => $this->app->getAppName (),
'welcomeMessage' => $this->welcomeMessage,
'endpoint' => $this->route->root (),
'valueBag' => json_encode(ValueBag::getValues()),
'bodyclass' => 'login-page',
Expand Down
42 changes: 42 additions & 0 deletions src/CrudKit/Util/Installer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace CrudKit\Util;

use Composer\Script\Event;
use Composer\Installer\PackageEvent;

class Installer {
private static function recursiveCopy ($source, $dest) {
if (!is_dir($dest)) {
mkdir($dest, 0755, true);
}
foreach (
$iterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($source, \RecursiveDirectoryIterator::SKIP_DOTS),
\RecursiveIteratorIterator::SELF_FIRST) as $item
) {
if ($item->isDir()) {
$target = $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName();
if (!is_dir($target))
mkdir($target);
} else {
echo "Copying:\nSource:". $item."\nDestination:".$dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName()."\n\n";
copy($item, $dest . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
}
}
}
public static function copyFiles (Event $event) {
$composer = $event->getComposer ();

$vendorPath = $composer->getConfig()->get('vendor-dir');
$root = dirname($vendorPath);
$ds = DIRECTORY_SEPARATOR;

$src = $vendorPath.$ds."skyronic".$ds."crudkit".$ds."src".$ds."static".$ds."build".$ds;
$dest = $root.$ds."public".$ds."static".$ds."crudkit";

echo "Copying crudkit static files... \n\n";
self::recursiveCopy ($src, $dest);
echo "Done!\n\n";
}
}
161 changes: 0 additions & 161 deletions src/static/build/css/crudkit.min.css

Large diffs are not rendered by default.

476 changes: 0 additions & 476 deletions src/static/build/js/crudkit.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/templates/includes/requires_prod.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<link href="{{ staticRoot }}/build/css/crudkit.min.css" type="text/css" rel="stylesheet" />
<script src="{{ staticRoot }}/build/js/crudkit.min.js" type="text/javascript"></script>
<link href="{{ staticRoot }}css/crudkit.min.css" type="text/css" rel="stylesheet" />
<script src="{{ staticRoot }}js/crudkit.min.js" type="text/javascript"></script>


2 changes: 1 addition & 1 deletion src/templates/pages/login.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% if error %}
<div class="alert alert-error">{{ error }}</div>
{% endif %}
<p class="login-box-msg">Please sign in</p>
<p class="login-box-msg">{{ welcomeMessage }}</p>

<form action="" method="post">
<div class="form-group has-feedback">
Expand Down

0 comments on commit c675717

Please sign in to comment.