Coder Social home page Coder Social logo

Comments (4)

kenjis avatar kenjis commented on July 28, 2024

In the case of redirect(), if we want to keep the function same as before (it seems the current implementation is it), I think we have to throw an exception, instead of calling exit().

Catching the exception in CodeIgniter.php and go to the end of the file. So we don't have to call exit() and we can exit CodeIgniter safely.

I don't know another way to remove exit() in the code now.

from codeigniter4.

lonnieezell avatar lonnieezell commented on July 28, 2024

I think you're right about how to handle the redirect() method. And that provides the best reasoning to encapsulate CodeIgniter as a class, honestly.

We want to be able to provide the exit codes so we can continue to provide the responses during exits for other scripts to monitor. We can pass those exit codes in the exceptions. Additionally, different types of exceptions can be provided for the more severe log levels, allowing the system to take some automatic action when those types of errors happen.

All of that works cleanest with CI as an object. I still have other objections/concerns about some of the details in your class, though. :)

from codeigniter4.

kenjis avatar kenjis commented on July 28, 2024

Removed exit() in redirect(): #49

from codeigniter4.

lonnieezell avatar lonnieezell commented on July 28, 2024

So are we good close this, then? That was the main blocker, right?

from codeigniter4.

Related Issues (20)

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.