how to use third party script with codeigniter - codeigniter

i have got third polling scripts which has it's own admin panel, i want to integrate with my existing codeigniter site, what is the best way to iplement it ?

You should put the polling script into application/libraries and then initialize it using $this->load->library('yourclass'); Here is the documentation from the user guide.

Copy the files of the 3rd party script into a folder application/third_party
Refer to the script using require_once APPPATH . '/third_party/script_folder/script.main.class.php';

Related

autoload twilio in codeigniter

I have just downloaded twilio-php-master.zip and extracted the file to the libraries folder in codeigniter. I would like to know what files to set on $autoload['libraries'] = array() to use the REST API.
Thank you.
First extract the Twilio folder inside the twilio-php-master.zip into the same level as your applications folder in codeigniter,
Next set $config['composer_autoload'] = 'Twilio/autoload.php'; in your config.php
lastly add use Twilio\Rest\Client; in the controller where you are going to use Twilio
Hope this helps you...

Is there a class or a way that lets you run laravel code via command line?

I'm managing a website where I need to update its contents by getting rss feeds, I'm always going to my update link/route via web browser to update.
I'm planning to use crontab so that I don't need to manually update it, So is there a way to run that code via command line?
In short: Yes.
Laravel has an extensive CLI interface which allows you to do exactly that. In these commands, you have access to all Laravel resources as if it was run by the webserver.

Avoid Direct Download Link of files

I am using Wordpress and Easy Digital Download plugin to sell digital files.
I have the following how-to questions:
How to avoid a user to see or to use direct download link?
How to create a download link that has an expiration like session?
How to secure a wp-contents/uploads folder?
You might be interested in this:
deny direct access to a folder and file by htaccess
simply put a .htaccess file with the content "deny from all" in the folder.
Then only scripts from your webspace should be able to read files from there.
This should be a first step. You would need a php-file serving the data instead of accessing those files directly.
Eg like this: http://www.kavoir.com/2009/05/php-hide-the-real-file-url-and-provide-download-via-a-php-script.html
(as I am not aware of wordpress plugins, maybe just google for them, this explains how to write those in php - if you cant do that youre pretty much stuck to wordpress plugins)
Nah, Nah, Nah... It's easy man update your plugin, and check your settings...
Step 2. You will see in you plugin settings, that it has 24 hours expiration date download link in forwarded email
"WP Secure Links" is WordPress plugin at codecanyon that lets you create a secure link to downloadable files.
http://codecanyon.net/item/wp-secure-links/4418678
http://sixthlife.net/product/wp-secure-links/
for securing the uploads folder needs some good .htaccess work
check the comments section of this, its explained
Still relevant in 2020 so I have written a small plugin that enables secure and temporary downloads in Wordpress:
WP DISPATCHER
It is free and simple. Check it out :)

Calling Magento API Script from Admin Backend

Ive writte a little Magento API script which gets some order data and writes it to a *.csv file.
Is it possible to make it so that the scipt can be run from the Admin Backend? For example can I add a button to the Admin area that will run my script?
Thanks in advance for your help!
Yes it is possible... but I don't think that will be the right approach. Could you elaborate a bit more in what needs do you have to get order information out of Magento by using the API?
If you are going to extract information out of Magento from another system then the API will be your best solution, but if in turn you have access to the admin try thinking other ways to get this job done without using the api.

how to run an admin task in joomla with a cron job?

I wrote a custom component in Joomla! that pulls in content from an XML feed and stores it in the Joomla database. I want the admin URL (/administrator/index?option=com_mycomp) to run via cron once every night to run the component. I can't figure out how to make this work, though, since the component is an administrator task and you have to be logged in to run it.
How do I get by this? I tried including my user/pw in the url (http:admin:password#www.mysite.com/joomla/administrator....) but it doesn't work. Is there anyway other way to send login credentials, or any other way to do this?
I know this thread is very old, but here's how I handled a similar task.
The "trick" is to take the custom PHP code you have created, and embed it into an article within your Joomla website.
I did this by using the JUMI extension, that allows custom PHP code to be stored within the Joomla repository and embedded, as required, within an article.
Then, create a CRON task that will activate the appropriate URL for the page containing the code you want to run.
Just put your script in the administrator directory of the component like
/administrator/components/com_yourcomponent/cron.yourcomponent.php
This is how FeedGator handles cron tasks [Sounds very similar to what you're trying to do.] ... you can also write a frontend controller in your component per one of the comments
========== [Update] ============
I created this ultra-simple installable component that could also be used for this purpose. It allows for a frontend menu item to be assigned to a php page (including the route as suggested). So you:
install the component
create new menu item, (may want to use a 'hidden' menu) select the 'show' view option and enter the script to run via cron in 'file to include' like path/yourcron.php
call the 'page' in your cron or test using: yourjoomlasite.com/index.php?option=com_show or yourjoomlasite.com/your-menu-alias
Mostly corn urls works from front-end even if your component deals with administrator only in Joomla.
So whatever your code in admin cron get it to front-end & so that your cronurl becomes like index.php?option=com_yourcomponent&task=cronjob.
Use this url to set cron using cPanel.
However this solution doesn't need to see whether admin is logged or not.

Resources