Codeigniter. extract XLS file to array or similar - php

I'm using CI 2.0.2 and am trying to import a simple XLS file for my site.
Eventually, I'll be inserting that data into a DB, but for now, I just need an array of the data. (I'm going to be running checks on the data first)..
I've never written a plugin for CI and am greatly confused by all the dependancies of these suggestions found in other posts:
Reading an XLS file with codeigniter 2.0
Perhaps this I should be asking 'how to write a plugin'?
Anyhoo, if there's a definative XLS -> array for CI tutorial out there, I can't find it..
I've tried a few methods, but am fearful of over padding my CI directories with 'useless' files.
Feel free to flame me... I'm just tearing out my hair...

Handling XLS files is an utter nightmare... I've tried lots of libraries (both CI and native PHP) and found nothing that works.
Is saving as a CSV a possibility?

Related

Symfony - How to upload large files to onedrive?

Hello, how are you?
Currently, I am building a symfony project(symfony 5.4).
I am going to write a standalone upload script to upload backup files(.zip files) automatically to OneDrive.
And the files are up to 5 GB.
But I am not sure what should I start from and how to implement it.
If someone who has experiences in it, please let me know the way.
Any comment or suggestion will welcome.
Thanks.
In the spirit of open source, whenever you need a specific requirement, most probably someone else has published a library for it. You are in luck because there is already https://github.com/krizalys/onedrive-php-sdk. You can either use that library or reverse engineer from the source code to implement into your Symfony code base.

Backup and download .sql file Laravel 4

A project i am currently working on requires the ability to export the full database with a click of a button in an admin area of a website. I know theres plenty of packages out there for automatic backups to dropbox etc.. But thats not what is required for this project.
I was just wondering is there a fast and easy way to just dump the full database in laravel 4?
I can handle the zipping and downloading of the file once its been dumped just wondering if theres an easy way to dump a database with laravel 4.
Any help appriciated
Thanks
Although packages like https://github.com/heybigname/backup-manager are perfect for backing up a database. They offer a lot more than i needed for this particular project.
In the end i used https://github.com/bradcornford/Backup which is a great package for backing up your database on the fly with one simple method.

CakePHP export html/data to PowerPoint Format

I am facing a problem with CakePHP 2.X. My client wants to export some data generated from a mysql database, to a powerpoint (.ppt or .pptx) format(s) in a specific template. I allready knew the PHPPowerPoint is at the alpha status so I don't want to make a plugin for Cake based on this. I also found
this! little gem but It works only for Windows PHP and I am using a linux based server (CentOs).
It is possible to create an xml or an html, encoded with something compatible of powerpoint format and just put the right php headers at the top? And what is this something?
or a better solution is there an api or a plugin something to work for all the platforms?
And could this plugin or api is compatible for Cake?
Thank you
PHPPowerPoint seem to be at a good place now, check out their GitHub: PHPPowerpoint
Installation instructions: http://phppowerpoint.readthedocs.org/en/latest/installing.html

File upload in with Lithium framework

How does Lithium framework file upload work with MySQL? I can find only tutorials and information with MongoDB. Tried to do that with MySQL but failed, upload doesn't work.
Can someone explain how it works with simple example?
Do it like you would using plain PHP.
MongoDB has GridFS where you can store files, which can be done in MySQL too (using BLOB) but is not recommended. Use the filesystem instead move_uploaded_file().
I'm working on a plugin, much like paperclip for rails. it's called li3_attachable and can be found here https://github.com/sandelius/li3_attachable.
It's not ready yet but I hope it should be stable this weekend. I've also added some docs in the wiki.

Automatic DB setup for CakePHP plugins

Let me disclaim first, that I'm a total CakePHP newbie. I am pretty proficient in PHP and MySQL however, having developed my own frameworks, etc., until I saw that other frameworks have already done the work for you :/ I'm trying to get into CakePHP cuz it has great documentation, good organization and the powerful console.
I've gone through the basics now and am trying to look into plugins - I have decided to start with the comments plugin, found at: http://cakedc.com/eng/downloads/view/cakephp_comments_plugin
I followed the first few lines of instructions to where I'm supposed to see the thing work, but it gave me errors about missing tables (e.g. Database table comments for model Comment was not found.). Certain I'll find a file, I've found this: /app/plugins/comments/config/schema/schema.php. The $comments array looks like it's formatted to be automated, instead of creating tables manually. But googling has failed to produce a good guide.
What line of instruction am I missing? Is there a way to use the console to convert this array (and other schema the plugin may require) into the DB scheme? Is there a script I should run every time I install a plugin?
Thanks in advance for your help.
You load the schema via the cake shell. More info here: h
http://book.cakephp.org/view/1524/Generating-and-using-Schema-files

Categories