I want to use php script to import data from excel file to mysql data base
I found this turorial Here which is so clear but in my case I use symfony framework and I don't know how can I include phpExcel_IOFactory .
can someone help me please?
composer require phpoffice/phpexcel
will take care of installing and loading the classes. After that, just use something like:
$reader = \PHPExcel_IOFactory::createReaderForFile($filename);
$reader->setReadDataOnly(true);
$wb = $reader->load($filename);
$ws = $wb->getSheet(0);
Note the forward slash in front of the class name.
Simple you have to add phpoffice/phpexcel in your vendors. run:
php composer.phar require phpoffice/phpexcel
And that's all.
Related
I am using JsStore with angular 6 and I am getting this error when try to import it with file-loader
" import * as workerPath from 'file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.js' ".
It show cannot find module 'file-loader?name=scripts/[name].[hash].js!jsstore/dist/jsstore.worker.js'.
Adding the extra folder with worker.d.ts file doesn't help in angular library generated with the new 'ng generate library' because the library use roll-up instead of web-pack and doesnt has a file-loader. Could you suggest me another way to import jsstore.worker.js, please?
There are multiple approach to do it -
You can copy the jsstore script in a folder then supply the path of the worker to jsstore instance.
e.g -
var con = new JsStore.Instance(new Worker('path of the jsstore worker script'));
But it would be better if we can include the script directly into the code, so that webpack or any other module bundler can take care of everything. We need to find a way to do it.
Another approach would be to run jsstore without worker (i dont recommend it, as it is slower). Check out the example - https://github.com/ujjwalguptaofficial/JsStore/tree/master/examples/ts%20without%20worker
Hope this helps.
Prologue: I'm playing for the first time with Laravel.
I'd like to use the 'laravel-mix' to run a php lint on my php files when file changes.
Is this doable?
I looked at official doc about Laravel-mix but I found no examples about PHP files
At the end I understand that It's not possible.
Laravel right tool is Envoy. I created Enojy tasks/stories and all now can run well
I am moving from asterisk 1.x to 13.6.In current implementation to dynamically register/unregister asterisk as different sip clients I use following trick: In sip.conf file I include my custom conf file which I update(add/remove) with "register =>..." and then "sip reload".
Do we have better way to do this in new asterisk version?
As variant I would like to include in sip.conf not single file but several from specific folder. Is it possible in asterisk config files?
Thank you in advance!
Asides from using realtime (https://wiki.asterisk.org/wiki/display/AST/Realtime+Database+Configuration) and sorcery (https://wiki.asterisk.org/wiki/display/AST/Sorcery+Caching), you can use "exec".
I'm not sure this is the desired way to do this, but you can take advantage of the "exec" include, see: https://wiki.asterisk.org/wiki/display/AST/Using+The+include,+tryinclude+and+exec+Constructs
So Asterisk would execute a script of yours (shell, php, ruby, etc) that will output everything you need, and there's no need to add multiple "include" statements.
For this to work you should have in your asterisk.conf:
execincludes = yes
Not performant, not pretty, might have some security issues if you are not careful, but could do the job if you don't want to use any realtime or sorcery configuration.
I m using yii2 2.0-dev AdvancedTemplate and need to add another environment (API),
similar to the currently working Frontend, Backend.
I tried to copy the files and search trough the settings but there are still some errors
and I feel this is the wrong way to do it...
There should be automated/console way to do this... but I find nothing in the docs.
Any ideas ?
Just create folder API in /environments/[prod|dev|other] and call ./init command
Sorry for the noob question but I'm trying to start up a new application with Sails and include my assets. I'm using Bower to manage my packages for things like Bootstrap and JQuery. I had a read of this question and added a .bowerrc file which is now installing my Bower components to /assets.
I'm now confused as to how I should proceed to add these files into my project. It seems as though I can't just do a <script> tag in the header as I'm used to because it's giving me a file not found. Reading through the sails documentation it seems like Grunt should be creating a .tmp/public/assets folder in my project, but whenever I run sails lift and go to .tmp/ there is nothing in there.
I also read in the documentation that I should be using some kind of asset injection, I tried adding this to my HTML and it seems like it doesn't do anything.
My other question is around how I go about referencing images in my HTML. Obviously I can't just do something like src='assets/images/image.png, how should I go about this? Is there something really obvious that I'm missing?
Sails use grunt tasks to do lot of things during lift and build. You can get much better look how everything work if you take some time and check what is inside Gruntfile.js from root of your sails project.
About your specific question here is some information:
- from sails docs: "In order to take advantage of asset injection, minification, and concatenation you must put your assets in folder under assets/linker". This exactly mean that everything what you will put inside assets/linker directory will be affected by grunt tasks during lift. It mean that all files/directories from linker will be copy to .tmp/public and also some of that files will be processed before saved to .tmp/public.
- About adding tags. If you take a look at Gruntfile.js you will find this variables: var cssFilesToInject = [...] and var jsFilesToInject = [...] which contain files that will be automatic added to layout header during sails lift.
- About your 'other question', yes you can do something like 'src='linker/images/image.png' if you move that files to linker directory (assets/linker).
I hope this help :).