Git Product home page Git Product logo

framework's People

Contributors

boxbillinggit avatar circle8z avatar kenjis avatar mruz avatar ovr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

framework's Issues

Unable to load dynamic library '/usr/lib64/php/modules/ice.so'

help!

Starting php-fpm: [24-Feb-2017 09:42:45] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/ice.so' - /usr/lib64/php/modules/ice.so: undefined symbol: php_json_decode_ex in Unknown on line 0

PHP Version 7.0.16
centos6.3

Pass di when register module autoloaders

it'll be very convenient to access DI instance when ModuleInterface::registerAutoloaders() is changed to ModuleInterface::registerAutoloaders(variable $di) .

    public function registerAutoloaders()
    {
        (new Loader())
            ->addNamespace(__NAMESPACE__ . '\Controllers', __DIR__ . '/controllers/')
            ->register();
    }

VS

    // better performance
    public function registerAutoloaders(Di $di)
    {
        $di->loader->addNamespace(__NAMESPACE__ . '\Controllers', __DIR__ . '/controllers/');
    }

Unique validator and Mongo ID

If i set rules like this and I want to edit model

$validation = new Validation();
$validation->rules([
    'shortName' => 'required|unique:categories,shortName,' . $this->getId() . '|length:2,16',
]);

It is not working because in mongo there is _id instead of id.

Model unserialize Exception

I'm getting error exception after sign in with remember me option:

ErrorException[8]: unserialize(): Error at offset 0 of 34 bytes

It occurs on one app, but not with another. Looks like error with fcache (works before this commit) or zephir latest changes.

Strange trace:

#0 [internal function]: unserialize('Ice\\Auth\\Driver\\Model\\Users\\Tokens')
#1 [internal function]: Ice\Mvc\Model->unserialize('Ice\\Auth\\Driver\\Model\\Users\\Tokens')
#0 [internal function]: unserialize('echo')
#1 [internal function]: Ice\Mvc\Model->unserialize('echo')
#0 [internal function]: unserialize('1\x00\x00\x00\x00\x00\x00\x001\x00\x00\x00\x00\x00\x00')
#1 [internal function]: Ice\Mvc\Model->unserialize(Array)
#2 [internal function]: Ice\Auth\Driver\Model->getUser()

It may be related with the crypt.zep#L100, because auth/driver/model.zep#L185 launches cookies.zep#L102 during remember me option. Auth and Crypt uses unserialize function but with diferent data.

If I change serialize/unserialize to json_encode/json_decode in the mvc/model.zep#L622 or disable cookies encrypt it works. I'm trying to add code to reproduce this issue.

Pdo

I create a new class that extend Ice\Db\Driver\Pdo, but I got follow error :

Call to private method Ice\Db\Driver\Pdo::where() from context 'App\Libraries\DBDriver'

I 'd better change where method to protected.any idea?

Is there a method overwriting $_POST?

After checking if the request failed to pass validation,
I want to use the filtered values as the form's values.
Example:

$filteredValues = $this->validation->getValues();
$this->request->setPost($filteredValues);

radio_field() doesn't work when the validation has a error.

Could you confirm the following example?

Example

Controller

$genders = [1 => 'male', 2 => 'female'];
$this->view->setVars(compact('genders'));

View

{% set field = 'gender' %}
{% foreach genders as key : value %}
    <label>
        {{ radio_field([field, key, 'id' : field ~ key, 'checked' : (this.request.getPost(field) == key ? 'checked' : '')])
        {{ value }}
    </label>
}}
{% endforeach %}

Could you teach me how to use an IN clause?

I want to use an IN clause as the following example.

Users::find(['status' => ['NOT IN' => [0, 1]], 'deleted_at' => ['IS' => null]]);
Users::find(['status' => ['IN' => [2, 3]], 'deleted_at' => ['IS' => null]]);

Unable to load dynamic library '/usr/lib64/php/modules/ice.so'

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/ice.so' - /usr/lib64/php/modules/ice.so: undefined symbol: zval_used_for_init in Unknown on line 0
include_path => .:/usr/share/pear:/usr/share/php => .:/usr/share/pear:/usr/share/php

php version 7.1.21
Centos 7.5

Url // and local false

If static_uri is without scheme eg. //example.com, it will be always marked as local, so

{{ link_to([this.url.getStatic('contact'), 'Contact', 'local': false]) }}
{# will be ///example.com/contact #}

What's the story on this vs phalcon?

Hello,

Don't see a forum or whatever to post this question.

I'm just curious about what is the story with this framework? Is it a fork of phalcon, completely new but using zephir, etc?

I know there are threads regarding the slow progress, lack of PR merges and that kind of thing and people wanting cphalcon to move to an organization. Is that the reason or intent behind ice?

Thanks!

How to render out fatal errors

Sorry for this simple question. how can i setup to output when there are fatal errors happen. I got a blank page at this moment.

Allow to render page without main layout

If I want to render some partial html, I have to return a response object in the controller action. that limitation is a little tricky

class IndexController extends \Ice\Mvc\Controller {

    public function indexAction()
    {
        $this->view->setContent('bla bla zzz');     // not work, no main layout file
    }
    public function index2Action()
    {
        $this->response->setContent('bla bla zzz'); 
        return $this->response;                            // work!
    }
}

loader addNamespace bug

$loader->addNamespace('', __DIR__ . '/Vendor/Parsedown')
or $loader->addNamespace('/', __DIR__ . '/Vendor/Parsedown')
or $loader->addNamespace("\\", __DIR__ . '/Vendor/Parsedown')
doesn't work for Parsedown class dropped in __DIR__ . '/Vendor/Parsedown' directory.

$mk = new Parsedown; // class not found

please fix line 78,these is no \ in the class name

rename ice/auth/driver/model.zep to db.zep

I am so very confused by the name of ice/auth/driver/model.zep. it has nothing to do with model. rename it to db.zep would be more clear.

db.zep -- database driver
file.zep -- file base driver

model hooks bug for cross instances

all these model hook names should have prefix or postfix to distinct different model type instances.

    model.before.validate
    model.after.validate
    model.before.create
    model.after.create
    model.before.update
    model.after.update

e.g.

class Model1 extends \Ice\Mvc\Model {
    public function initialize()
    {
        $v = 'Model1';
        $this->di->hook('model.before.validate', function () use ($v) {
            echo 'model.before.validate:'.$v.'<br>';
        });
    }
    public function apply()
    {
        $this->di->applyHook("model.before.validate", [$this]);
    }
}
class Model2 extends \Ice\Mvc\Model {
    public function initialize()
    {
        $v = 'Model2';
        $this->di->hook('model.before.validate', function () use ($v) {
            echo 'model.before.validate:'.$v.'<br>';
        });
    }
    public function apply()
    {
        $this->di->applyHook("model.before.validate", [$this]);
    }
}
$m1 = new Model1;
$m2 = new Model2;
$m3 = new Model1;
$m1->apply();

// echo
model.before.validate:Model1
model.before.validate:Model1  <---- double run
model.before.validate:Model2  <---- shouldn't be executed

Int filter in getPost() method

If i do sth like this in the mongodb Model:

$this->position = $this->request->getPost('position', 'int');
$this->create()

I have numeric string representation instead of int

Could you teach me how to use LIKE clause?

I would like to use a LIKE clause as the following example.

$name = $this->request->getPost('name');

$escapedName = $this->example->escapeLike($name);

$users = Users::find(['name' => ['LIKE' => '%' . $escapedName . '%']]);
class Example {
    /**
     * Escape for MySQL's LIKE clause
     * @param string $string
     * @return string
     */
    public function escapeLike($string)
    {
        return str_replace(['%', '_'], ['\%', '\_'], $string);
    }
}

Problem with controller directory

Handler Class with application/Controllers/ doesn't work.

ice-php/
.. application/
.. .. Controllers/
.. .. ..

Any idea?

I think this framework so simple than Phalcon but need more documentation like Bootstrap, Routing, Controller, Models, and other basics. And I have'nt found forum.

Sorry for My English, thanks!

Model::getId bug

Model::getId

fixed

    public function getId()
    {
        if (is_array($this->primary)) {
            $id = [];
            foreach ($this->primary as $k) {
                $id[] = $this->get($k);
            }
        } else {
            $id = $this->get($this->primary);
        }
        return $id;
    }

Set reponse content in controller fail

$this->response->setContent('bla bla zzz') in the controller will not work

class IndexController extends \Ice\Mvc\Controller {

    public function indexAction()
    {
        $this->response->setContent('bla bla zzz');
    }
}

Can this framework support Oracle database?

I tried to use ice,and set oracle as project's database, it not work,Is this framework not support Oracle?

`
$di->set('db', function () {
$tns = '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=orcl)))';
$driver = new \Ice\Db\Driver\Pdo("oracle:dbname=" . $tns, 'user', 'password');
// not work too
// $driver = new \Ice\Db\Driver\Pdo("oci:dbname=orcl;host=localhost", 'user', 'password');

return new \Ice\Db($driver);

});
`

What different of other frameworks?

Hello.

I'm finding some PHP7 frameworks and see some benchmark pages.
This framework looks like so fast. amazing. but I don't know other features...

So what key points of this framework? now I'm planning use to lumen because I'll make not too big product.

Router, Multiple optional parameters

Multiple nested optional parts are not working:

$this->di->set('router', function () use ($config) {
    $router = new Router();
    $router->setRoutes([
        ['GET', '/{controller:[a-z]+}/{action:[a-z]+}[/{id:\d+}[/{param}]]'],
    ]);
    return $router;
});

should cover:
/post/list
/post/edit/1
/post/show/1/title

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.