Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dp-ifacesoft committed Mar 18, 2015
1 parent 30e26e7 commit d8e2ad5
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 51 deletions.
2 changes: 1 addition & 1 deletion Config/Ice/Core/View/Render.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'dataProviderKey' => 'Ice:Registry/view_render',
'vendor' => 'smarty/smarty',
'templates_c' => 'smarty/templates_c/',
'plugins' => [ICE_DIR . 'Vendor/Smarty/plugins']
'plugins' => [MODULE_DIR . 'vendor/Smarty/plugins']
],
'Ice\View\Render\Twig' => [
'vendor' => 'twig/twig',
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
[Ice](http://iceframework.net) [![Build Status](https://travis-ci.org/ifacesoft/Ice.svg)](https://travis-ci.org/ifacesoft/Ice)
===

scrutinizer-ci.com:
[![Build Status](https://scrutinizer-ci.com/g/ifacesoft/Ice/badges/build.png?b=master)](https://scrutinizer-ci.com/g/ifacesoft/Ice/build-status/master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ifacesoft/Ice/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ifacesoft/Ice/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/ifacesoft/Ice/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/ifacesoft/Ice/?branch=master)

codeclimate.com:
[![Code Climate](https://codeclimate.com/github/ifacesoft/Ice/badges/gpa.svg)](https://codeclimate.com/github/ifacesoft/Ice)
[![Test Coverage](https://codeclimate.com/github/ifacesoft/Ice/badges/coverage.svg)](https://codeclimate.com/github/ifacesoft/Ice)

[![Latest Stable Version](https://poser.pugx.org/ifacesoft/ice/v/stable.svg)](https://packagist.org/packages/ifacesoft/ice)
[![Total Downloads](https://poser.pugx.org/ifacesoft/ice/downloads.svg)](https://packagist.org/packages/ifacesoft/ice)
[![Latest Unstable Version](https://poser.pugx.org/ifacesoft/ice/v/unstable.svg)](https://packagist.org/packages/ifacesoft/ice)
Expand Down Expand Up @@ -105,7 +100,7 @@ Composer install via shell:
$ php composer.phar create-project ifacesoft/ice Ice dev-master
$ ./Ice/cli Ice:Module_Create

Zip archive istall:
Zip archive install:

1. Download and unpack .zip
2. $ ./Ice/cli Ice:Composer_Update
Expand Down
9 changes: 8 additions & 1 deletion Source/Ice/Action/Composer/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
namespace Ice\Action;

use Ice\Core\Action;
use Ice\Core\Logger;
use Ice\Helper\Console;

/**
* Class Composer_Update
Expand Down Expand Up @@ -85,6 +87,11 @@ protected static function config()
*/
public function run(array $input)
{
passthru('cd ' . ICE_DIR . ' && php composer.phar self-update && php composer.phar update');
Console::run([
'cd ' . MODULE_DIR,
'php composer.phar self-update',
'php composer.phar clear-cache',
'php composer.phar update'
]);
}
}
10 changes: 6 additions & 4 deletions Source/Ice/Class/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ public function generate($data)
{
$namespace = Object::getNamespace($this->_baseClass, $this->_class);

$path = Module::SOURCE_DIR;
$module = Module::getInstance(Object::getModuleAlias($this->_class));

if ($namespace) {
$path .= 'Model/';
}
$path = $module->get(Module::SOURCE_DIR);

// if ($namespace) {
// $path .= 'Model/';
// }

$filePath = $path . str_replace(['\\', '_'], '/', $this->_class) . '.php';

Expand Down
10 changes: 6 additions & 4 deletions Source/Ice/Code/Generator/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ public function generate($class, $data, $force = false)
// $class = Object::getClass(Action::getClass(), $data);
$namespace = Object::getNamespace(Action::getClass(), $class);

$path = Module::SOURCE_DIR;
$module = Module::getInstance(Object::getModuleAlias($class));

if ($namespace) {
$path .= 'Class/';
}
$path = $module->get(Module::SOURCE_DIR);

// if ($namespace) {
// $path .= 'Class/';
// }

$filePath = $path . str_replace(['\\', '_'], '/', $class) . '.php';

Expand Down
10 changes: 6 additions & 4 deletions Source/Ice/Code/Generator/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ public function generate($class, $data, $force = false)

$fieldNames = Arrays::column($data['columns'], 'fieldName');

$path = Module::SOURCE_DIR;
$module = Module::getInstance(Object::getModuleAlias($class));

if ($namespace) {
$path .= 'Model/';
}
$path = $module->get(Module::SOURCE_DIR);

// if ($namespace) {
// $path .= 'Model/';
// }

$filePath = $path . str_replace(['\\', '_'], '/', $class) . '.php';

Expand Down
10 changes: 6 additions & 4 deletions Source/Ice/Code/Generator/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ public function generate($class, $data, $force = false)
// $class = Object::getClass(Core_Validator::getClass(), $data);
$namespace = Object::getNamespace(Core_Validator::getClass(), $class);

$path = Module::SOURCE_DIR;
$module = Module::getInstance(Object::getModuleAlias($class));

if ($namespace) {
$path .= 'Class/';
}
$path = $module->get(Module::SOURCE_DIR);

// if ($namespace) {
// $path .= 'Class/';
// }

$filePath = $path . str_replace(['\\', '_'], '/', $class) . '.php';

Expand Down
4 changes: 2 additions & 2 deletions Source/Ice/Core/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ public static function call(array $input = [], $level = 0)
$actionContext = Ice::getContext()->initAction($actionClass, $hash);

/** @var Action $action */
$action = $actionCacher->get($actionHash);

// $action = $actionCacher->get($actionHash);
$action = null;
if (!$action) {
$action = $actionClass::create();

Expand Down
20 changes: 13 additions & 7 deletions Source/Ice/Helper/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,22 @@ public static function getInteractive($class, $param, $data)

public static function run($commands, $toDevNull = false)
{
$commandString = '';

foreach ((array)$commands as $command) {
if ($toDevNull) {
$command .= ' > /dev/null 2>&1';
}
$commandString .= $command . ' && ';
}

if (Request::isCli()) {
fwrite(STDOUT, Console::getText($command, Console::C_GREEN_B) . "\n");
};
$commandString = substr($commandString, 0, -4);

passthru($command);
if ($toDevNull) {
$commandString .= ' > /dev/null 2>&1';
}

if (Request::isCli()) {
fwrite(STDOUT, Console::getText($commandString, Console::C_GREEN_B) . "\n");
};

passthru($commandString);
}
}
36 changes: 18 additions & 18 deletions Source/Ice/Model/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ class Test extends Model
protected static function config()
{
return [
'revision' => '03071316_L4',
'dataSourceKey' => 'Ice\\Data\\Source\\Mysqli/default.test',
'revision' => '03180947_4b',
'dataSourceKey' => 'Ice\Data\Source\Mysqli/default.test',
'scheme' => [
'tableName' => 'ice_test',
'engine' => 'InnoDB',
'charset' => 'utf8_general_ci',
'comment' => 'dsdsddsdddsdsd',
'comment' => '',
],
'schemeHash' => 3201865154,
'schemeHash' => 3368682505,
'columns' => [
'id' => [
'scheme' => [
Expand All @@ -41,9 +41,9 @@ protected static function config()
],
'schemeHash' => 708064701,
'fieldName' => 'test_pk',
'Ice\\Core\\Form' => 'Number',
'Ice\\Core\\Validator' => [],
'Ice\\Core\\Data' => 'text',
'Ice\Core\Form' => 'Number',
'Ice\Core\Validator' => [],
'Ice\Core\Data' => 'text',
],
'test_name' => [
'scheme' => [
Expand All @@ -52,18 +52,17 @@ protected static function config()
'dataType' => 'varchar',
'length' => '52',
'characterSet' => 'utf8',
'nullable' => false,
'nullable' => true,
'default' => null,
'comment' => '',
],
'schemeHash' => 336823333,
'schemeHash' => 3726904188,
'fieldName' => 'test_name',
'Ice\\Core\\Form' => 'Text',
'Ice\\Core\\Validator' => [
'Ice\Core\Form' => 'Text',
'Ice\Core\Validator' => [
'Ice:Length_Max' => 52,
0 => 'Ice:Not_Null',
],
'Ice\\Core\\Data' => 'text',
'Ice\Core\Data' => 'text',
],
'name2' => [
'scheme' => [
Expand All @@ -72,17 +71,18 @@ protected static function config()
'dataType' => 'varchar',
'length' => '65',
'characterSet' => 'utf8',
'nullable' => true,
'nullable' => false,
'default' => null,
'comment' => '',
],
'schemeHash' => 2521633375,
'schemeHash' => 3057425486,
'fieldName' => 'name2',
'Ice\\Core\\Form' => 'Text',
'Ice\\Core\\Validator' => [
'Ice\Core\Form' => 'Text',
'Ice\Core\Validator' => [
'Ice:Length_Max' => 65,
0 => 'Ice:Not_Null',
],
'Ice\\Core\\Data' => 'text',
'Ice\Core\Data' => 'text',
],
],
'indexes' => [
Expand Down
Binary file modified composer.phar
Binary file not shown.

0 comments on commit d8e2ad5

Please sign in to comment.