Coder Social home page Coder Social logo

itsgoingd / clockwork Goto Github PK

View Code? Open in Web Editor NEW
5.5K 62.0 318.0 11.45 MB

Clockwork - php dev tools in your browser - server-side component

Home Page: https://underground.works/clockwork

License: MIT License

PHP 99.88% HTML 0.12%
clockwork php laravel devtools logging debugging profiling

clockwork's People

Contributors

akalongman avatar alies-dev avatar auchanhub avatar bafs avatar bradestey avatar christopherh0rn avatar dominicdetta avatar edgardmessias avatar faytekin avatar garbee avatar hermanzhu avatar itsgoingd avatar jerguslejko avatar julianmar avatar lenssoft avatar lubatti avatar matiux avatar meanevo avatar mortenscheel avatar n-m avatar osbre avatar pqr avatar pwhelan avatar ryzr avatar sloveniangooner avatar ssnepenthe avatar thattomperson avatar ulricheckhardt avatar villermen avatar yannikfirre 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  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

clockwork's Issues

Error after install

After adding to composer and update ide-helper write this error on generating:

PHP Fatal error:  Call to undefined method Illuminate\Support\Facades\Auth::driver() in PATH/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 205

[Request] Option to ignore certain types of files

When using codesleeve/asset-pipeline with Laravel 4 each asset is served up over a route provided through a service provider. While this might be nice for some users, for the most part it is something I'd like to have hidden so I only see controller requests from the application.

Perhaps Clockwork could ignore routes ending in asset filetypes (images, fonts, scripts, etc.) or provide an option to exclude certain routes, controllers or the like.

Redirect::to(...) in App:before Filter causes Error (L4.0)

Hi,

I use my App::before Filter to check if the first segment of the requested URL is an available locale (e.g en or de) if it's not, it Redirects to a default -> because there is no Route set for this.

When i redirect it throws an error, on line 183 of LaravelDataSource.php (calling getAction() on a non Object)

here is my little fix:

protected function getController()
{
$router = $this->app['router'];

if (method_exists($router, 'getCurrentRoute')) { // Laravel 4.0
    // $controller = $router->getCurrentRoute()->getAction();
    $current = $router->getCurrentRoute();
    $controller = (is_null($current)) ? null : $current->getAction();
} else { // Laravel 4.1
    $controller = $router->current()->getActionName();
}
if(!is_null($controller))
{
    if ($controller instanceof Closure) {
        $controller = 'anonymous function';
    } else if (is_object($controller)) {
        $controller = 'instance of ' . get_class($controller);
    } else if (is_array($controller) && count($controller) == 2) {
        if (is_object($controller[0]))
            $controller = get_class($controller[0]) . '->' . $controller[1];
        else
            $controller = $controller[0] . '::' . $controller[1];
    } else if (!is_string($controller)) {
        $controller = null;
    }
}   
return $controller;

}

Greetings :-)

Database use optional?

Hi, some applications might not use a database. I have only tried clockwork with Laravel 4 so I don't know if this is a general issue. Would it make sense to make database use optional by having some config variable that lets clockwork skip it's database profiling?

Extend clockwork

Regards, and thanks for being working on this.
I want to extend the clockwork with custom tab from server side. Is that possible?

Add support for multiple database connections

My current laravel project uses multiple database connections. Clockwork will only register one EloquentDataSource for the default connection, so you will only see queries for that connection in the logs. It would be nice to have an array with connection names in the package config file, so that a data source is created for all the connections in the array.

Consider using Boot method for router call in Laravel's Service Provider

I ran into an issue where there was no output in Chrome coming from Laravel 4.1.

Using the methods in #3, I was able to see that the headers were correctly being sent.

Moving the router call to the Service Provider's boot() method instead of the register() method fixed the issue for me.

Let me know if you'd like PR. Or, maybe using the boot method would cause other issues?

Works only on Ajax Requests

Any idea why this is only showing profiling information for AJAX requests? I tried everything without luck. Thanks!

Laravel + Clockwork + Chrome not working

So after many hours of frustration here's where I'm at.

  1. Brand new installation of Laravel 4 (v4.1.21)
  2. Added "itsgoingd/clockwork": "1.*" to my composer.json file.
  3. Ran composer update and Clockwork (v1.4.4) installed.
  4. I added the 'Clockwork\Support\Laravel\ClockworkServiceProvider' to my providers array, and added 'Clockwork' => 'Clockwork\Support\Laravel\Facade', to my aliases array.
  5. I added the following to my app/filters.php file:
App::before(function($request)
{
Event::fire('clockwork.controller.start');
});


App::after(function($request, $response)
{
Event::fire('clockwork.controller.end');
});
  1. Ran a composer dump-autoload -o for good measure.
  2. Next I boot up laravel using php artisan serve and we're running on (localhost:8000).
  3. I hit localhost:8000 in chrome, check the headers and here's where things get strange :)

The headers read:

X-Clockwork-Id:1392079506.9878.449334262
X-Clockwork-Version:1.4.2

Note: Composer installed Clockwork v1.4.4 , which is weird?

This is from my composer.lock file:

    "name": "itsgoingd/clockwork",
        "version": "v1.4.4",
        "source": {
            "type": "git",
            "url": "https://github.com/itsgoingd/clockwork.git",
            "reference": "2d39c88ba507fde4bd21b11971e429762303224c"
        }

I hit the clockwork tab in Chrome (Version 32.0.1700.107) and nothing appears.

I do at this point have .json' files inapp/storage/clockwork` containing all the correct data that should be being displayed by the Chrome extension.

A few points where I feel the issue could be laying are:

  1. The use of PHP's built-in web server?
  2. Using SQLite as the database driver of choice?
  3. Chrome on Ubuntu LInux (which I am using).

I've seen other's mention that white space has been an issue for them, but this isn't the case here. I'll be interested to see if there's a solution to this.

got an 'CI_Controller ' error when try to run on laravel

Class 'CI_Controller' not found

I use Laravel and my controller at path app/Mycontrol/fileuseclockwork.php
at fileuseclockwork.php
use Clockwork;
Clockwork::info('test']);
That error.

before that app/controller/fileuseclockwork.php
at fileuseclockwork.php
Clockwork::info('test']);
it use fine.

Why this error?

Empty list in Canary

I'm using Laravel 4 on a nginx webserver on a OSX 10.9 machine. JSON files are generated with each request, just the Chrome Canary Clockwork tab stays empty.

screenshot 2013-11-24 12 56 33

Session updates on chrome clockwork tab when clicking on different items.

My guess is
when I click on an item on the clockwork tab, a request is sent to the same route and thus my app is executed and some session information is changed.
So my captcha doesnt work.
I use Laravel 4.0, captcha / mews / clockwork - latest.
disabling clockwork in chrome browser and restarting the page solves the issue..

Routes list

A list of all routes would also be usefull. I might take a swing at this for L4.

Blank Output in Chrome

Hello,
I installed Clockwork for Chrome and set the provider and alias in Laravel. I extended the Basecontroller too.

I see in the app/storage/clockwork folder json-files filling up. I read already the other closed issue "blank output". But disabling other profiler don't help me.

Trying this URL: http://my_host/__clockwork/1385391368.3305.1545016532 I get only a header, but no response:

Request URL:http://my_host/__clockwork/1385391368.3305.1545016532
Request Method:GET
Status Code:200 OK
Request Headersview source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip,deflate,sdch
Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
Cache-Control:no-cache
Connection:keep-alive
Cookie:laravel_session=eyJpdiI6IlplQ3BVbkd3dDVhcGRzb0xYaW8rWVhuMFFNTFppNFhJcThERHg5VDBZaEk9IiwidmFsdWUiOiJjSUNlZE1Nc3JMR1k2Ykw3d2JSdkpCaUdjYlIwVTBDMk9ubU5LSFdjdDNxMFRCWk1cL3ExWjkzTmVEYStwbGNNMldlYzkxc293NDgzVTFcL3R4Z21qeXNRPT0iLCJtYWMiOiJjOTcwMDFkNTBhOWFhZGQ4NGQzZDI4OWVjNGY3M2E4ZTJkODRmNDYwYWVjNjdmZTE3YTAzMzQxNmJhZWU4ZDMzIn0%3D
Host:my_host
Pragma:no-cache
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36
Response Headersview source
Connection:Keep-Alive
Content-Type:text/html
Date:Fri, 17 Jan 2014 07:56:57 GMT
Keep-Alive:timeout=5, max=100
Server:Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.8y DAV/2 PHP/5.4.4
Transfer-Encoding:chunked
X-Powered-By:PHP/5.4.4

Can you help me please? I want to use your tool!

SQLSTATE[HY000] [2002] No such file or directory

Just installed clockwork 1.* in a fresh Laravel 4.2 project, as soon as I added the service provider config i get this error :(

PDOException thrown with message "SQLSTATE[HY000] [2002] No such file or directory"

Stacktrace:
#26 PDOException in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:47
#25 PDO:__construct in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:47
#24 Illuminate\Database\Connectors\Connector:createConnection in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php:20
#23 Illuminate\Database\Connectors\MySqlConnector:connect in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php:59
#22 Illuminate\Database\Connectors\ConnectionFactory:createSingleConnection in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php:47
#21 Illuminate\Database\Connectors\ConnectionFactory:make in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php:127
#20 Illuminate\Database\DatabaseManager:makeConnection in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php:63
#19 Illuminate\Database\DatabaseManager:connection in /Users/wayne/source/primedia-cms/source/vendor/itsgoingd/clockwork/Clockwork/Support/Laravel/ClockworkServiceProvider.php:63
#18 Clockwork\Support\Laravel\ClockworkServiceProvider:Clockwork\Support\Laravel\{closure} in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Container/Container.php:498
#17 Illuminate\Container\Container:build in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Container/Container.php:425
#16 Illuminate\Container\Container:make in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:463
#15 Illuminate\Foundation\Application:make in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Container/Container.php:809
#14 Illuminate\Container\Container:offsetGet in /Users/wayne/source/primedia-cms/source/vendor/itsgoingd/clockwork/Clockwork/Support/Laravel/ClockworkServiceProvider.php:99
#13 Clockwork\Support\Laravel\ClockworkServiceProvider:Clockwork\Support\Laravel\{closure} in <#unknown>:0
#12 call_user_func_array in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:199
#11 Illuminate\Events\Dispatcher:fire in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:154
#10 Illuminate\Events\Dispatcher:until in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Routing/Router.php:1244
#9 Illuminate\Routing\Router:callFilter in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Routing/Router.php:972
#8 Illuminate\Routing\Router:dispatch in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:738
#7 Illuminate\Foundation\Application:dispatch in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:708
#6 Illuminate\Foundation\Application:handle in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Session/Middleware.php:72
#5 Illuminate\Session\Middleware:handle in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Cookie/Queue.php:47
#4 Illuminate\Cookie\Queue:handle in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Cookie/Guard.php:51
#3 Illuminate\Cookie\Guard:handle in /Users/wayne/source/primedia-cms/source/vendor/stack/builder/src/Stack/StackedHttpKernel.php:23
#2 Stack\StackedHttpKernel:handle in /Users/wayne/source/primedia-cms/source/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:606
#1 Illuminate\Foundation\Application:run in /Users/wayne/source/primedia-cms/source/public/index.php:49
#0 require_once in /Users/wayne/source/primedia-cms/source/server.php:19

Chrome DevTools panel empty with Slim

Hi
I tried to install clockwork with slim 2 and the result is that I do not see anything in the Chrome DevTools panel.
I saw the issue #3 and I tried to the route http://your-host/__clockwork/ID, but actually I do not see anything, even though I see in the folder configured the json files named with the correct ID that is passed into the headers of the page.

I've done something wrong? I have to apply some particular rule inside my .htaccess?

here's my .htaccess configuration

<IfModule mod_rewrite.c>
    Options -MultiViews
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

Laravel storage folder needs a .gitignore file

When the clockwork folder is created inside app/storage, a .gitignore file also needs creating containing the following:

*
!.gitignore

That way, the JSON files won't show up as unstaged changes in Git.

Cheers,

Dan

Events are listed out of order.

When calling Clockwork::info() to output debug information, the items show up in Chrome in a random order. They're probably sorted by the "time" column by default, but that is only accurate to the nearest second, so the debug information is displayed in an order that is essentially random.

This can be an issue if you need to know the actual sequence of events.

clockwork headers not being sent

Hi,

trying to set this up with Laravel - I get the feeling I'm missing a step somewhere.
The json files are generated correctly, accessing them through /__clockwork/{id} works, but the Clockwork tab in the Chrome extension remains empty. I checked the response headers and it looks like X-Clockwork-Id and X-Clockwork-Path are not being set.

Any ideas what might be causing this? Clockwork is explicitly enabled in the published config file, and the start and stop events are being fired from my base controller's constructor.

JSON data requested from root even when app installed in subfolder.

I have a Slim 2.3.2 app installed in subfolder in dev.example.com/foo/ Nothing appears to Clockwork extension pane.

I can access the json data from dev.example.com/foo/__clockwork/id. However I can see from the logs Clockwork extension is trying to retrieve the data from root.

dev.example.com ::1 - - [14/Oct/2013:22:37:19 +0300] "GET http://dev.example.com/__clockwork/1381779436.7567.898323514 HTTP/1.1" 404 235

Workaround is to have a hook which sends the correct path in X-Clockwork-Path header.

$app->hook("slim.before", function() use ($app) {
    $app->response->headers->set("X-Clockwork-Path", "/foo/__clockwork/");
});

json_encode(): recursion detected

I am getting the above error from the FileStorage class

Not too sure what is causing it, it is reproducible by going to a specific page, it is only happening on one server but not the other, and there are no get, or post requests on this page.

Any ideas?

Option to clear clockwork requests log?

Currently there doesn't seem to be a way to clear the log of requests without closing/reopening the devtools. (Or am I missing something?)

Would it be possible to add a clear icon (like in the main Network tab) to clear all recent requests?

?foo=1 in GET request not being parsed correctly

When I add ?foo=1 or ?foo=123 in GET http request, the GET parameters in clockwork display an empty object instead of the integer number:

image 2014-01-30 at 4 50 13 pm

not sure if this is the intended parsed output. Strings get displayed correctly.

Laravel 4.2.10 - Target [Psr\Log\LoggerInterface] is not instantiable.

Upon updating to 4.2.10 I get this error when using the Laravel service provider.

Stack trace.

Illuminate\Container\BindingResolutionException thrown with message "Target [Psr\Log\LoggerInterface] is not instantiable."

Stacktrace:
#35 Illuminate\Container\BindingResolutionException in /vagrant/vendor/laravel/framework/src/Illuminate/Container/Container.php:513
#34 Illuminate\Container\Container:build in /vagrant/vendor/laravel/framework/src/Illuminate/Container/Container.php:428
#33 Illuminate\Container\Container:make in /vagrant/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:462
#32 Illuminate\Foundation\Application:make in /vagrant/vendor/laravel/framework/src/Illuminate/Mail/MailServiceProvider.php:247
#31 Illuminate\Mail\MailServiceProvider:Illuminate\Mail\{closure} in /vagrant/vendor/laravel/framework/src/Illuminate/Container/Container.php:214
#30 Illuminate\Container\Container:Illuminate\Container\{closure} in /vagrant/vendor/laravel/framework/src/Illuminate/Container/Container.php:501
#29 Illuminate\Container\Container:build in /vagrant/vendor/laravel/framework/src/Illuminate/Container/Container.php:428
#28 Illuminate\Container\Container:make in /vagrant/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:462
#27 Illuminate\Foundation\Application:make in /vagrant/vendor/laravel/framework/src/Illuminate/Container/Container.php:806
#26 Illuminate\Container\Container:offsetGet in /vagrant/vendor/laravel/framework/src/Illuminate/Mail/MailServiceProvider.php:102
#25 Illuminate\Mail\MailServiceProvider:Illuminate\Mail\{closure} in /vagrant/vendor/laravel/framework/src/Illuminate/Container/Container.php:214
#24 Illuminate\Container\Container:Illuminate\Container\{closure} in /vagrant/vendor/laravel/framework/src/Illuminate/Container/Container.php:501
#23 Illuminate\Container\Container:build in /vagrant/vendor/laravel/framework/src/Illuminate/Container/Container.php:428
#22 Illuminate\Container\Container:make in /vagrant/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:462
#21 Illuminate\Foundation\Application:make in /vagrant/vendor/laravel/framework/src/Illuminate/Container/Container.php:806
#20 Illuminate\Container\Container:offsetGet in /vagrant/vendor/laravel/framework/src/Illuminate/Mail/MailServiceProvider.php:38
#19 Illuminate\Mail\MailServiceProvider:Illuminate\Mail\{closure} in /vagrant/vendor/laravel/framework/src/Illuminate/Container/Container.php:214
#18 Illuminate\Container\Container:Illuminate\Container\{closure} in /vagrant/vendor/laravel/framework/src/Illuminate/Container/Container.php:501
#17 Illuminate\Container\Container:build in /vagrant/vendor/laravel/framework/src/Illuminate/Container/Container.php:428
#16 Illuminate\Container\Container:make in /vagrant/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:462
#15 Illuminate\Foundation\Application:make in /vagrant/vendor/laravel/framework/src/Illuminate/Container/Container.php:806
#14 Illuminate\Container\Container:offsetGet in /vagrant/vendor/itsgoingd/clockwork/Clockwork/Support/Laravel/ClockworkServiceProvider.php:49
#13 Clockwork\Support\Laravel\ClockworkServiceProvider:Clockwork\Support\Laravel\{closure} in /vagrant/vendor/laravel/framework/src/Illuminate/Container/Container.php:501
#12 Illuminate\Container\Container:build in /vagrant/vendor/laravel/framework/src/Illuminate/Container/Container.php:428
#11 Illuminate\Container\Container:make in /vagrant/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:462
#10 Illuminate\Foundation\Application:make in /vagrant/vendor/itsgoingd/clockwork/Clockwork/Support/Laravel/ClockworkServiceProvider.php:26
#9 Clockwork\Support\Laravel\ClockworkServiceProvider:boot in /vagrant/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:585
#8 Illuminate\Foundation\Application:Illuminate\Foundation\{closure} in <#unknown>:0
#7 array_walk in /vagrant/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:585
#6 Illuminate\Foundation\Application:boot in /vagrant/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:743
#5 Illuminate\Foundation\Application:handle in /vagrant/vendor/laravel/framework/src/Illuminate/Session/Middleware.php:72
#4 Illuminate\Session\Middleware:handle in /vagrant/vendor/laravel/framework/src/Illuminate/Cookie/Queue.php:47
#3 Illuminate\Cookie\Queue:handle in /vagrant/vendor/laravel/framework/src/Illuminate/Cookie/Guard.php:51
#2 Illuminate\Cookie\Guard:handle in /vagrant/vendor/stack/builder/src/Stack/StackedHttpKernel.php:23
#1 Stack\StackedHttpKernel:handle in /vagrant/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:641
#0 Illuminate\Foundation\Application:run in /vagrant/public/index.php:49

Codeigniter's hook filepath incorrect when APPPATH contains "../"

The title says it all. I have a project where the $application_folder and $system_path both are above CI's index.php like so:

$system_path = __DIR__.'/../framework/system';
$application_folder =  __DIR__.'/../framework/application';

This causes the filepath for the hooks filepath variable to be something weird such as:

'{public html dir}/../../../..//vendor/itsgoingd/clockwork/Clockwork/Support/CodeIgniter'

The correct filepath should be:

'{public html dir}/vendor/itsgoingd/clockwork/Clockwork/Support/CodeIgniter'

Any suggestions for this? Maybe we could have a CI config file where we can manually define the composer vendor directory with respect to CI's APPPATH?

404 Error

Installed Clockwork and using Laravel 4. When I check headers I get:

GET /__clockwork/1402170646.6961.2035025732 HTTP/1.1
Host: localhost
Accept: text/css,/;q=0.1
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Referer: http://localhost/
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36

HTTP/1.1 404 Not Found
Connection: Keep-Alive
Content-Length: 320
Content-Type: text/html; charset=iso-8859-1
Date: Sat, 07 Jun 2014 19:50:46 GMT
Keep-Alive: timeout=5, max=97
Server: Apache/2.4.9 (Win64) PHP/5.5.12

Using WAMP for local dev.

Cleaning Clockwork storage

Hi,

I noticed that, when using Clockwork in Laravel, the storage/clockwork directory gets bloated pretty fast. I figured it would be nice to have a command to fix that. I added the code in case you'd like to add it to the package.

I also updated my composer.json so that the directory gets cleaned after every update:

"post-update-cmd": [
            ...
            "php artisan clockwork:clean"
        ]

ClockworkCleanCommand.php:

<?

use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;

class ClockworkCleanCommand extends Command {

    /**
    * The console command name.
    *
    * @var string
    */
    protected $name = 'clockwork:clean';

    /**
    * The console command description.
    *
    * @var string
    */
    protected $description = 'Cleans the app/storage/clockwork directory';

    /**
    * Create a new command instance.
    *
    * @return void
    */
    public function __construct()
    {
        parent::__construct();
    }

    /**
    * Execute the console command.
    *
    * @return void
    */
    public function fire()
    {
        $this->info('Cleaning app/storage/clockwork...');

        $files = scandir(storage_path().'/clockwork/');
        foreach($files as $file)
        {
            if(substr($file, -4) == "json")
                unlink(storage_path().'/clockwork/'.$file);
        }

        $this->info('Done');
    }

}

?>

[Laravel 5] Issue with outputting PHP array

When using

$dogs = ['Gunner', 'Shilo'];
Log::info($dogs)

Seems Clockwork no longer outputs it as object (in clockwork console)

Instead it outputs as:

array(0 => 'Gunner', 1 => 'Shilo')

And is not an object

Am I missing something here?

Critical, Alert and Emergency come through with the wrong levels (maybe)?

After some local testing with Laravel for a new project I noticed that critical, alert and emergency appear as error, warning and error respectively in Chrome's dev tools. I found where this occurs in the code:
https://github.com/itsgoingd/clockwork/blob/master/Clockwork/DataSource/LaravelDataSource.php#L130

Is there a particular reason why? I only ask as for our purposes it would be useful for us to have these appear in the Clockwork Chrome app as their native error levels.

Apart from that the tool is really great, it's really helpful for us to test our app's bottlenecks ๐Ÿ‘ ๐Ÿ˜„

Laravel Route::enableFilter() problem

When I do a functional test in Larvavel and use Route::enableFilter() I get an error message:

This is my testcode:

    public function testRedirectedIfNotLoggedIn()
    {
        Route::enableFilters();

        $this->auth->logout();

        $response = $this->call('GET', 'rest/questionnaire/1');

        $this->assertRedirectedTo('/');
    }

and this is the error output in my console after I run phpunit:

{"error":{"type":"ErrorException","message":"Undefined index: REQUEST_METHOD","file":"\/Applications\/MAMP\/htdocs\/aletheio\/vendor\/itsgoingd\/clockwork\/Clockwork\/DataSource\/PhpDataSource.php","line":94}}

Do not have time at the moment to dig deeper. Just wanted to let you know.

No Results in Chrome (new Ticket for a slightly different issue)

I have clockwork actually setup and working in my local homestead environment, but on my production server it doesn't seem to work. The headers are coming through and the files are being generated, and if I navigate to them, they come back with valid json. Kind of don't know what else to do.
Just to note, even though this is a production server, I do have debug enabled for the time being (still technically in development).
Any Insight would be great

Laravel 4.1, nothing is logged in Clockwork Chrome extension

Hey,

Nothing is being logged in the Clockwork Chrome extension. I see the log files from clockwork in app/storage/clockwork but cannot nothing is returned via (as per the headers from Laravel)

mydomain.com/public/__clockwork/1388899685.2844.79942867

Any suggestions on this one? I've double and triple checked the steps you provided were followed to the T.

Clockwork in CakePHP

Hi, Does anyone have info on how to implement Clockwork in a CakePHP v2.3.7 project?

thanks!
Enrique

Laravel + Doctrine

In a old post I read of some people that have asked about Doctrine support. I use Laravel with Doctrine, so I was wondering if you are already thinking to add this Data Source.

blank output in dev tools

Hi

I have installed the dependency and updated the service provider in Laravel.

I correctly see the headers being set for clockwork and json files filling up the storage/clockwork directory, but I don't see any ouput.

Any ideas? Tried on an Ubuntu virtual machine connected from 31.0.1650.57 for Mac and also tried the same from MAMP

Any ideas?

Thanks

Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:no-cache
Connection:keep-alive
Cookie:laravel_session=uhefvq8o6tq7nt3klrd8ivd2s4
Host:local.research.designwerk
Pragma:no-cache
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36
Response Headersview source
Cache-Control:no-cache
Connection:Keep-Alive
Content-Encoding:gzip
Content-Type:text/html; charset=UTF-8
Date:Mon, 25 Nov 2013 15:06:34 GMT
Keep-Alive:timeout=5, max=100
Server:Apache
Set-Cookie:laravel_session=uhefvq8o6tq7nt3klrd8ivd2s4; expires=Mon, 25-Nov-2013 17:06:34 GMT; path=/; httponly
Transfer-Encoding:chunked
Vary:Accept-Encoding
X-Clockwork-Id:1385391994.24.2023036883
X-Clockwork-Version:1.1
X-Powered-By:PHP/5.4.4

Cleanup command needs --age flag.

Clockwork needs the ability to clean up after itself with a limitation.

We have clockwork:clean but it would be great it we could have

clockwork:clean --age=300 which would clean any files that are older than 300 minutes (5 hours).

This shouldn't be too difficult to implement since the files begin with microtime(true)."." you can just grab the first section (explode('.', $files)) and check if microtime(true) - ($ageFromCommand*60) >= $fileMicrotime if it is delete it, otherwise just skip the file.

The use case for this is an automated cleanup cron that runs every hour, we don't want to delete fresh data since we may need to analyze it if a user calls in with an error. but if it's older than 5 hours we presume it safe to delete.

Monolog integration

Integrating Clockwork with Monolog would be very interesting. FYI there is already a connector to FirePHP and ChromePHP in Monolog.

Permission error creating storage directory

I have confirmed the parent directory has correct privileges but still receive error? This is working with Slim framework

var_dump result --> string '/requests/storage/path' (length=22)

Slim Application Error
The application could not run because of the following error:

Details

Type: ErrorException
Code: 2
Message: mkdir(): Permission denied
File: /Users/mikee/Documents/Projects/slim-clockwork/vendor/itsgoingd/clockwork/Clockwork/Storage/FileStorage.php
Line: 26
Trace
#0 [internal function]: Slim\Slim::handleErrors(2, 'mkdir(): Permis...', '/Users/mikee/Do...', 26, Array)
#1 /Users/mikee/Documents/Projects/slim-clockwork/vendor/itsgoingd/clockwork/Clockwork/Storage/FileStorage.php(26): mkdir('/requests/stora...', 448, true)
#2 /Users/mikee/Documents/Projects/slim-clockwork/vendor/itsgoingd/clockwork/Clockwork/Support/Slim/ClockworkMiddleware.php(32): Clockwork\Storage\FileStorage->__construct('/requests/stora...')
#3 /Users/mikee/Documents/Projects/slim-clockwork/vendor/slim/slim/Slim/Middleware/PrettyExceptions.php(67): Clockwork\Support\Slim\ClockworkMiddleware->call()
#4 /Users/mikee/Documents/Projects/slim-clockwork/vendor/slim/slim/Slim/Slim.php(1261): Slim\Middleware\PrettyExceptions->call()
#5 /Users/mikee/Documents/Projects/slim-clockwork/public/index.php(40): Slim\Slim->run()
#6 {main}

Struggling to install under CodeIgniter

I've attempted to install Clockwork in a fresh copy of CodeIgniter 2.1.4, using Composer, and I'm unable to get it working correctly.

I've followed the instructions to the letter, but when I load a test controller, I get the message:

Fatal error: Class 'Clockwork\Support\CodeIgniter\Hook_Clockwork_Register' not found in /application/config/hooks.php 

It's as if Composer isn't loading Clockwork correctly, but I've installed a separate Composer package under the same test site, and this works fine. I am new to Composer, though, so I may have missed an important step; do I have to manually load Clockwork anywhere, or is Composer (and the CodeIgniter hook) designed to do this for me?

Exception before redirect

I use filter for authorization users:

Route::filter('auth', function()
{
    if ( ! Sentry::check())
    {
        Session::put('loginRedirect', Request::url());
        return Redirect::route('signin');
    }
});

But when condition it true clockwork show me Exception:
image

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.