Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
I want to import data from LinkedIn and save them in my database. I want this run at background.
So I create a console command. But how could I call a controller/action in a console command so that the import and save transaction could run at the console command at background?
I don't know what the structure of your application is, but if you want to allow a command to run something that a controller does, then the typical way to do that is by having the intended code in a service that both controller and command has access to.
By using a ContainerAwareCommand, you give the command instance access to the service container, and thusly the service. Controllers by default have access to the service container.
Try to avoid jury rigging parts of your application together when they are designed to be separate. Give them access to the same services, but keep them apart.
Thanks to Flosculus and sensi for helping me a lot.
In order to reach my goal, I first add a event listener when login.http://dev.dbl-a.com/symfony-2-0/how-to-add-a-symfony2-login-event-listener/
Then I add a process to make it work in background
http://symfony.com/doc/master/components/process.html
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'm trying to simulate a web browser in order to log into a secure site, where the site's backend seems to be written in some mix of PHP and ASP.NET, and retrieve some user details.
In order to fit my own project, the simulation results (i.e. the user details) must be returned to a PHP script for processing.
So far I've been working with CURL in PHP to do this, and realised that the site is far too complicated to use CURL effectively, and this method is far too slow to develop. What I would like is some sort of browser simulator that can:
Execute JavaScript
Submit forms
Click links
Handles cookies
Uses ASP.NET postbacks
Can access the DOM
Basically something that behaves exactly like a real browser, and can return the page source to me.
I've explored the Snoopy class in PHP and Capybara in Ruby. If I don't get any better options I will be forced to implement with one of these.
You have two options:
Use a headless browser. This is basically browser without any graphical output, which can be controlled via. code. You can check out Selenium and PhantomJS, there probably exists bindings for your language of choice.
Reverse their site. Do the login flow and actions needed to get to the resource you need, and look at the network traffic, for example with Chrome's developer tools. Look at the requests, headers and form data needed for the endpoints in question and emulate that in the code.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'm working on a PHP project using a PHP framework which i would like sell.
Someone wants to test the code on their server first.
I do not want to give away the source.
So is it possible to obfuscate the code?
Or may be compile it?
My primary objective is, they should not be able to just take the code, once it is on their server and cheat me. Also I do not want them to handover the code to another developer and get it reverse engineered or changed.
I'm looking for a free solution if possible.
You can use Zend Guard to do the same so that it will encrypt your whole code and will compile it so that no one can use your source code. it works same as we do in JAVA as it create byte code in class files.
Go through this link Zend Guard
Zend Guard, the most widely accepted PHP encoding and obfuscation product on the market
it will do following tasks for you:
Prevent reverse engineering & unauthorized modifications
Protect your code from unauthorized use
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
We are currently moving a lot of our code to use the api we've developed instead of making sql calls from our php. There will be a lot of functionality to test once this happens. I was wondering if you know of a good plugin or software to use to track and replicate and action (such as registering a user, the logging in, posting a comment, etc). I know there is software like selenium, but I've heard that it would be more of a hassle to setup than it's worth (for what we need it for).
I basically want to create a script of my actions on our stable build, then run that script on the build that is using our newly implemented api build that uses a different database, then come the two databases to make sure they have the same data.
Any suggestions would be great. There has to be a chrome plugin or something, but I haven't been be able to find it after a few hours of searching.
If these are web service calls to your API, you can use curl (on the command line or within PHP) or even Guzzle as it's just an HTTP Client for communicating with web services. What you are describing is testing your app, which is common. There is nothing trivial or easy about full test coverage so prepare to spend some time setting this up and working out the kinks.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I want to program a "Terminal" emulator in php and jquery or ajax.
My intention it's not to execute real terminal commands, I want to make commands like echo and retrieve me the results to an TextArea, or make commands like newuser and open me a jquery dialog or a webpage. Is there any way to do develop this thing?
The thing i want is a text area where i get the responses and a text input field where i put the commands. The function that needs to do is make a call to a php file where it manages the data input on the text field, compare and do some actions, like a simple echo or a dice rolling. I don't want to manage the system. Thanks to all
There are several remote (ajax) shells, which emulate a shell and forward the commands to to the real shell on the server via HTTP(S):
http://antony.lesuisse.org/software/ajaxterm/
http://www.squarefree.com/shell/shell.html
http://en.wikipedia.org/wiki/Web-based_SSH
You can check my jquery terminal emulator plugin it's the best solution if you want to implement custom commands that are implemented by you in PHP. You can also make a real Linux shell with it. But it was created to allow to create of the commands mostly in JavaScript. You can create almost anything you want.
But if you want to have real SSH you probably will not be able to use PHP and you will want xterm.js, but it requires running a server where you keep connection with the server. with jQuery Terminal you can just use PHP.
Check out the lithium php framework homepage: http://li3.me/
In the top left type help, and see what happens!
Check out the source for informations.
Not exactly what you were asking for, but there is a web terminal written in python+JS you may be interested in: http://antony.lesuisse.org/software/ajaxterm/
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Is there a PHP Sandbox, something like JSFiddle is to JS?
If you are just looking for an online site to play around with PHP code, try
http://phpfiddle.org/
http://ideone.com/
https://codeanywhere.net/
http://www.tehplayground.com/
http://sandbox.onlinephpfunctions.com/
http://codepad.org/
https://eval.in/
https://implode.io/ (permits attaching a version of the Laravel framework)
The most sophisticated is:
http://3v4l.org/
It lets you test your code in all PHP versions starting from PHP4.
If you want something for your local environment, the Runkit extension aims to provide a PHP Sandbox:
Instantiating the Runkit_Sandbox class creates a new thread with its own scope and program stack. Using a set of options passed to the constructor, this environment may be restricted to a subset of what the primary interpreter can do and provide a safer environment for executing user supplied code.
If you dont want to use Runkit but still want a PHP Console on your server, try
Jordi Boggiano's Blog - PHP Console in Your Browser
http://github.com/seldaek/php-console