Source code of Ice framework

Overview

Ice framework

Simple and fast PHP framework delivered as C-extension.

Latest Stable Version Total Downloads Latest Unstable Version License

Stage

Build Status

How to contribute?

  1. Fork the ice/framework repository.
  2. Create a new branch for each feature or improvement.
  3. Send a pull request from each feature branch to the dev branch*.

*please do not send files from build/ directory (they are generated automatically), just those from the ice/.

or become a contributor

Sponsors Backers

Benchmark

RPS

Installation

Ice is a C-extension, so you need to download a binary for your platform or compile it from source code.

Download

Donation

Support us with a donation and help us continue our activities. Become a contributor

Sponsors

Sponsors

Backers

Backers

License

Ice is open-sourced software licensed under the New BSD License. See the LICENSE file for more information.


Copyright (c) 2014-2021 Ice Team.

Comments
  • Could not install via PeCL

    Could not install via PeCL

    Hi @mruz,

    I've found that the version 1.6 is available through apecl channel :+1:

    However, using pecl install ice (I'm on a docker), I have :

    /bin/bash /tmp/pear/temp/pear-build-defaultuserqn3XAf/ice-1.6.0/libtool --mode=compile cc  -I. -I/tmp/pear/temp/ice -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserqn3XAf/ice-1.6.0/include -I/tmp/pear/temp/pear-build-defaultuserqn3XAf/ice-1.6.0/main -I/tmp/pear/temp/ice -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/ice/ice.c -o ice.lo
    mkdir .libs
     cc -I. -I/tmp/pear/temp/ice -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserqn3XAf/ice-1.6.0/include -I/tmp/pear/temp/pear-build-defaultuserqn3XAf/ice-1.6.0/main -I/tmp/pear/temp/ice -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/ice/ice.c  -fPIC -DPIC -o .libs/ice.o
    /bin/bash /tmp/pear/temp/pear-build-defaultuserqn3XAf/ice-1.6.0/libtool --mode=compile cc  -I. -I/tmp/pear/temp/ice -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserqn3XAf/ice-1.6.0/include -I/tmp/pear/temp/pear-build-defaultuserqn3XAf/ice-1.6.0/main -I/tmp/pear/temp/ice -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/ice/kernel/main.c -o kernel/main.lo
    /tmp/pear/temp/pear-build-defaultuserqn3XAf/ice-1.6.0/libtool: line 1283: kernel/main.loT: No such file or directory
    mkdir kernel/.libs
    mkdir: cannot create directory 'kernel/.libs': No such file or directory
    make: *** [Makefile:194: kernel/main.lo] Error 1
    ERROR: `make' failed
    

    Regards,

    opened by waghanza 18
  • Model unserialize Exception

    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.

    bug 
    opened by mruz 12
  • Pass di when register module autoloaders

    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/');
        }
    
    feature 
    opened by Yahasana 7
  • loader addNamespace bug

    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

    opened by Yahasana 6
  • Model, enhanced and bug fixed

    Model, enhanced and bug fixed

    1. no exception when create model by filters, you can test if it exists in db by (new iModel(['id' => 9]))->exists()
    2. fixed fineOne initial order: onConstruct --> load data from service --> initialize. the original order is: onConstruct --> initialize --> load data from service.
    3. only reset primary key after insert if the primary key is autoincrement
    4. minus enhancements
    5. disallow empty filters for loadOne
    6. fixed getRules('zzz') will return all rules
    7. getRelated filter with options works for has_one
    opened by Yahasana 4
  • Problem with controller directory

    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!

    opened by sayonara90s 4
  • Install ice via composer instead of pecl

    Install ice via composer instead of pecl

    Hi,

    Following https://github.com/dependabot/dependabot-core/issues/1990, you meqan @mruz that composer, with

    {
      "require": {
        "iceframework/framework": "~1.8.0"
      }
    }
    

    could handle ice compilation

    That's not what I have using composer install --no-dev --prefer-dist --classmap-authoritative (I'm using https://github.com/the-benchmarker/web-frameworks to try this).

    Regards,

    question 
    opened by waghanza 3
  • fix build with recent GCC

    fix build with recent GCC

    Trying to build with GCC 10

    /usr/bin/ld: kernel/.libs/main.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first defi
    ned here
    /usr/bin/ld: kernel/.libs/memory.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first de
    fined here
    /usr/bin/ld: kernel/.libs/exception.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first
     defined here
    /usr/bin/ld: kernel/.libs/debug.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first def
    ined here
    /usr/bin/ld: kernel/.libs/object.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first defined here
    /usr/bin/ld: kernel/.libs/array.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first defined here
    /usr/bin/ld: kernel/.libs/string.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first defined here
    /usr/bin/ld: kernel/.libs/fcall.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first defined here
    /usr/bin/ld: kernel/.libs/require.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first defined here
    /usr/bin/ld: kernel/.libs/file.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first defined here
    /usr/bin/ld: kernel/.libs/operators.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first defined here
    /usr/bin/ld: kernel/.libs/math.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first defi
    ...
    

    Use PHP 7 ZEND_TSRMLS_CACHE way instead (tsrm_ls is no more needed)

    opened by remicollet 3
  • Unable to load dynamic library '/usr/lib64/php/modules/ice.so'

    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

    opened by legolass73 3
  • Could you teach me how to use an IN clause?

    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]]);
    
    fixed bug help 
    opened by circle8z 3
  • Install on alpine

    Install on alpine

    Hi @mruz,

    To build ice on alpine, we need libexecinfo-dev.

    This package has been retired and will not be included in alpine anymore https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/36722

    Is there any workaround ?

    Regards,

    opened by waghanza 0
  • Assets loading with themes and skins supported

    Assets loading with themes and skins supported

    Assets loading with themes and skins supported. assume that different apps (or plugins) are independent with each others but share the same basic modules and public resources

    A) asset cases: there are stylesheet files in public css share by all apps and app specific stylesheet locate in its directory. e.g.

    • public/css/style.css
    • public/min/css/style.min.css
    • app/account/skin/default/css/account.css
    • public/min/css/account.min.css

    B) loading source and target

    1. load the min file
      • a) load from public: /css/style.css ===> public/min/css/style.min.css minify public/css/style.css to public/min/css/style.min.css
      • b) load from app dir: css/account.css ===> public/min/css/account.min.css minify account/default/css/account.css to public/min/css/account.min.css
    2. load the raw file
      • a) load from public: /css/style.css ===> public/css/style.css
      • b) load from app dir: default/css/account.css ===> public/default/css/account.css
        • i) if public/default/css/account.css not exists, copy account/default/css/account.css to public/default/css/
        • ii) else update account/default/css/account.css to public/default/css/

    C) implement

    1. if uri is start with /, it'll try to load asset from document root
    
    $mySkin = 'Default';
    
    // Register specific services for the module
    public function registerServices(Di $di)
    {
        $di->assets->setOptions([
                'source' => __DIR__ . '/Skin/' . $mySkin . '/',
                'target' => 'min/',
                'minify' => 3
            ]);
    }
    
    // css used by specific module
    // load from module dir/Skin/Default/css/account.css
    $this->assets->addCss(['css/account.css']); 
    
    // css shared by all modules
    // load from document_root/Skin/Default/css/style.css
    $this->assets->addCss(['/Skin/' . $mySkin . '/css/style.css']); 
    
    1. always store the min files in the document_root/target dir

    ONE MORE THING

    type parameter change from text/css or text/javascript to css or js

    $assets->addCss(['css/style.css', 'type' => 'css'])
    ->addCss(['js/script.js', 'type' => 'js'])
    

    but not

    $assets->addCss(['css/style.css', 'type' => 'text/css'])
    ->addCss(['js/script.js', 'type' => 'text/javascript'])
    opened by Yahasana 2
  • What different of other frameworks?

    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.

    question 
    opened by mcddx330 4
Owner
ice framework
PHP framework written in Zephir delivered as a C-extension
ice framework
Source Code for 'Pro PHP 8 MVC' by Christopher Pitt

Apress Source Code This repository accompanies Pro PHP 8 MVC by Christopher Pitt (Apress, 2021). Download the files as a zip using the green button, o

Apress 27 Dec 25, 2022
Open Source PHP Framework (originally from EllisLab)

What is CodeIgniter CodeIgniter is an Application Development Framework - a toolkit - for people who build web sites using PHP. Its goal is to enable

B.C. Institute of Technology 18.2k Dec 29, 2022
Open Source PHP Framework (originally from EllisLab)

CodeIgniter 4 Development What is CodeIgniter? CodeIgniter is a PHP full-stack web framework that is light, fast, flexible and secure. More informatio

CodeIgniter 4 web framework 4.5k Jan 2, 2023
Elgg is an open source rapid development framework for socially aware web applications.

Elgg Elgg is an open source rapid development framework for socially aware web applications. Features Well-documented core API that allows developers

Elgg 1.6k Dec 27, 2022
Coole is a PHP framework built on open source components

Coole is a PHP framework built on open source components. - Coole 是一个基于开源组件包构建的 PHP 框架。

guanguans 20 Jan 7, 2023
Low-code Framework for Web Apps in PHP

Agile UI - User Interface framework for Agile Toolkit Agile Toolkit is a Low Code framework written in PHP. Agile UI implement server side rendering e

Agile Toolkit 404 Jan 8, 2023
An intelligent code generator for Laravel framework that will save you time

An intelligent code generator for Laravel framework that will save you time! This awesome tool will help you generate resources like views, controllers, routes, migrations, languages and/or form-requests! It is extremely flexible and customizable to cover many of the use cases. It is shipped with cross-browsers compatible template, along with a client-side validation to modernize your application.

CrestApps 621 Jan 8, 2023
CleverStyle Framework is simple, scalable, fast and secure full-stack PHP framework

CleverStyle Framework is simple, scalable, fast and secure full-stack PHP framework. It is free, Open Source and is distributed under Free Public Lice

Nazar Mokrynskyi 150 Apr 12, 2022
I made my own simple php framework inspired from laravel framework.

Simple MVC About Since 2019, I started learning the php programming language and have worked on many projects using the php framework. Laravel is one

null 14 Aug 14, 2022
PHPR or PHP Array Framework is a framework highly dependent to an array structure.

this is new repository for php-framework Introduction PHPR or PHP Array Framework is a framework highly dependent to an array structure. PHPR Framewor

Agung Zon Blade 2 Feb 12, 2022
I made my own simple php framework inspired from laravel framework.

Simple MVC About Since 2019, I started learning the php programming language and have worked on many projects using the php framework. Laravel is one

Rizky Alamsyah 14 Aug 14, 2022
Framework X – the simple and fast micro framework for building reactive web applications that run anywhere.

Framework X Framework X – the simple and fast micro framework for building reactive web applications that run anywhere. Quickstart Documentation Tests

Christian Lück 620 Jan 7, 2023
Framework X is a simple and fast micro framework based on PHP

Framework X is a simple and fast micro framework based on PHP. I've created a simple CRUD application to understand how it works. I used twig and I created a custom middleware to handle PUT, DELETE methods.

Mahmut Bayri 6 Oct 14, 2022
Spiral Framework is a High-Performance PHP/Go Full-Stack framework and group of over sixty PSR-compatible components

Spiral HTTP Application Skeleton Spiral Framework is a High-Performance PHP/Go Full-Stack framework and group of over sixty PSR-compatible components.

Spiral Scout 152 Dec 18, 2022
Sunhill Framework is a simple, fast, and powerful PHP App Development Framework

Sunhill Framework is a simple, fast, and powerful PHP App Development Framework that enables you to develop more modern applications by using MVC (Model - View - Controller) pattern.

Mehmet Selcuk Batal 3 Dec 29, 2022
An issue tracking tool based on hyperf+reactjs for small and medium-sized enterprises, open-source and free, similar to Jira.

介绍 本项目以 actionview 为蓝本,使用 Hyperf 框架进行重写。 本项目为 Hyperf 框架的 DEMO 项目 原 ActionView 介绍 English | 中文 一个类Jira的问题需求跟踪工具,前端基于reactjs+redux、后端基于php laravel-frame

Gemini-D 14 Nov 15, 2022
A lightweight solution for running code concurrently in PHP

A lightweight solution for running PHP code concurrently This package makes it easy to run PHP concurrently. Behind the scenes, concurrency is achieve

Spatie 602 Dec 29, 2022
This repository holds the code and script for the Symfony5 Tutorials on SymfonyCasts.

Tutorials, Friendship & Symfony5 Well hi there! This repository holds the code and script for the Symfony5 Tutorials on SymfonyCasts. Setup If you've

null 1 Nov 20, 2021