Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Laravel News:
Laravel Telescope Beta Now Available
Oct 24, 2018 @ 17:09:57

On the Laravel News site they have a post about the Laravel Telescope beta that's just been announced. Laravel Telescope is an introspection and debugging tool that integrates with your Laravel application to provide details gathered during execution and issues along the way.

The first beta release of Laravel Telescope is now out and available for everyone. If you are not familiar with Telescope here is the quick overview:

Laravel Telescope is an elegant debug assistant for the Laravel framework. Telescope provides insight into the requests coming into your application, exceptions, log entries, database queries, queued jobs, mail, notifications, cache operations, scheduled tasks, variable dumps and more. Telescope makes a wonderful companion to your local Laravel development environment.

You can get the beta by installing it through Composer.

You install it the same way you'd install any other Laravel package via a composer require for laravel/telescope and run the installation and migration steps using the artisan command. This tool is only for Laravel applications and is tightly integrated with the tool. For more information on Telescope, check out its GitHub repository.

tagged: laravel telescope introspection tool debugging beta announcement

Link: https://laravel-news.com/laravel-telescope-beta

NetTuts.com:
Reflection in PHP
Apr 19, 2013 @ 15:24:28

On NetTuts.com today there's a new tutorial talking about a part of PHP that can be quite powerful but isn't used too often - reflection in PHP. Using Reflection you can get information about your actual code and its elements without having to try to parse it yourself.

Reflection is generally defined as a program’s ability to inspect itself and modify its logic at execution time. In less technical terms, reflection is asking an object to tell you about its properties and methods, and altering those members (even private ones). In this lesson, we’ll dig into how this is accomplished, and when it might prove useful.

They provide a little context around the idea of "reflection" in programming languages and then jump right in with a few sample classes. They set up their "Nettuts", "Manager" and "Editor" classes and show how to use the ReflectionClass functionality to get their structure. The examples show how to get the class' methods, their properties and calling these methods using things like invoke and call_user_func.

tagged: reflection tutorial introspection methods parameters invoke

Link: http://net.tutsplus.com/tutorials/php/reflection-in-php

PHPMaster.com:
Introspection and Reflection in PHP
May 25, 2012 @ 19:03:57

On PHPMaster.com today there's an introduction to Reflection, a feature of PHP that allows you to peer into the code itself and find out metadata like class properties, scope levels and parent classes.

PHP introspection is a common feature in any programming language which allows object classes to be manipulated by the programmer. You’ll find introspection particularly useful when you don’t know which class or method you need to execute at design time. [...] During this article, you’ll see a couple examples of how to use some of the most useful PHP’s introspection function and a section dedicated to an API that offers functionality similar to introspection, the Reflection API.

They introduce you to a few different methods including class_exists, get_class and get_class_vars and method_exists. They also briefly mention the "ReflectionClass" that's a part of the PHP Reflection API and how it can be used to make an instance pointing to a current class.

tagged: introspection reflection tutorial api metadata

Link:

Maarten Balliauw's Blog:
A client side Glimpse to your PHP application
Aug 03, 2011 @ 16:28:54

Maarten Balliauw has announced the release of a PHP port of a powerful tool for server-side introspection of your applications - Glimpse for PHP.

A few months ago, the .NET world was surprised with a magnificent tool called "Glimpse". Today I'm pleased to release a first draft of a PHP version for Glimpse! Now what is this Glimpse thing… Well: "what Firebug is for the client, Glimpse does for the server... in other words, a client side Glimpse into whats going on in your server."

He includes a of how the introspection works and some sample code using a phar to add it to your PHP application. You can see it in action in this screencast based on the PHP Azure Contest website. He also shows one very cool feature that allows for cross-device tracking of requests. You can find this PHP port of Glimpse on github.

tagged: glimpse port introspection phar server plugin client

Link:

Elated.com:
Object-Oriented PHP: Autoloading, Serializing, and Querying Objects
Jul 01, 2011 @ 13:29:45

On Elated.com today there's the fourth part of their series looking at object oriented programming in PHP. This time the focus is specifically on autoloading classes, making objects into strings (serialized) and introspection.

If you've read all the articles up to this point then you're already familiar with the most important concepts of object-oriented programming in PHP: classes, objects, properties, methods, and inheritance. In this final (for now, at least!) tutorial in the series, I'm going to tie up some loose ends and look at some other useful OOP-related features of PHP.

He looks at each of the three topics above and includes code for things like a simple autoloader, object serialization, using sleep/wakeup and an example of using functions like get_class, get_class_methods and get_object_vars to do introspection on your classes and objects.

tagged: oop tutorial class object autoload serialize introspection

Link:

Alexey Zakhlestins' Blog:
GObject for PHP (new bindings project)
Feb 24, 2011 @ 14:25:23

In a new post Alexey Zakhlestins talks about a project he's been working on, a part of the split up with PHP-GTK out into separate projects. His part of the group is GObject with has now been moved over to github.

This new PHP extension is called "GObject for PHP", so, my main concern, obviously is building comfortable bridge between GObject objects and PHP's objects. It starts to work, but there's a lot of stuff to be done. Please join the project, if you are interested. We need more hands!

He describes some of the features already in the library - counterparts for parts of the current GObject world in PHP including GType, GSignal and GParamSpec. This is all on the master branch. In his "introspection" branch he's working on the introspection idea the GNOME community has been working towards too.

tagged: phpgtk gobject binding github master introspection

Link:

Springboard Software Blog:
Using Introspection in PHP
Jun 27, 2006 @ 16:48:01

In this new post on the Springboard Software blog today, Michael takes a look at a very handy feature that PHP has to offer those working with objects - a form of introspection.

One of the things we love about Java is its ability to use introspection. Don't know what methods or field an object has? Just ask it.

It turns out that PHP provides some nifty introspection features as well. We've found one to be particularly useful: the ability of a PHP object to tell us its member variables at runtime. Not sure what that means? Let’s look at an example.

In his example, he uses a content management system, specifically the "business objects" to illustrate his point. Introspection comes into play when the get_class_vars function is called, returning the defined variables for an object and allowing one to feed in values to be automagically set (in this case, either an array, a request, or a primary key for a record from the database).

tagged: introspection objects businessobject get_class_vars get_class introspection objects businessobject get_class_vars get_class

Link:

Springboard Software Blog:
Using Introspection in PHP
Jun 27, 2006 @ 16:48:01

In this new post on the Springboard Software blog today, Michael takes a look at a very handy feature that PHP has to offer those working with objects - a form of introspection.

One of the things we love about Java is its ability to use introspection. Don't know what methods or field an object has? Just ask it.

It turns out that PHP provides some nifty introspection features as well. We've found one to be particularly useful: the ability of a PHP object to tell us its member variables at runtime. Not sure what that means? Let’s look at an example.

In his example, he uses a content management system, specifically the "business objects" to illustrate his point. Introspection comes into play when the get_class_vars function is called, returning the defined variables for an object and allowing one to feed in values to be automagically set (in this case, either an array, a request, or a primary key for a record from the database).

tagged: introspection objects businessobject get_class_vars get_class introspection objects businessobject get_class_vars get_class

Link:


Trending Topics: