I am creating an application and will be deployed to production soon.
For the ease of convenience, I would like to create a custom setup and installation page which will allow users to input variable values to be used in config/main.php as well as to execute the RBAC setup and create necessary tables.
For most web application, there is an 'install' folder which users point their browsers to and begin the app installation. How do I implement something similar in Yii?
I think a great start were the app manager extension which provides much of what you need. It doesn't do anything with the RBAC setup, though. Perhaps you want the auth extension as well?
Yii does not have an installation folder, you just download and extract it and put in your server like Wamp/Xampp or etc. and then you can install a new Yii application through command prompt.
C:\wamp\bin\php\php5.4.16> "c:\wamp\www\yii\framework\yiic.bat" webapp "c:\wamp\
www\newyii"
When you run above command, then you will see the following command.
Create a web application under 'c:\wamp\www\newyii'? [no]:
You write Y. and then create your new application.
For more understanding. you should follow the below link.
http://www.yiiframework.com/doc/guide/1.1/en/quickstart.installation
Thanks.
Related
I am new to Nextcloud app development and would like to create a simple app to play around. I saw that some apps are made with Vue.js, so I’m asking if there is a guide out there?
I generated an app skeleton and played around with the PHP templates but unfortunately I don’t know PHP and would like to create a Vue.js project into this existing demo app.
I found some premade Vue components for Nextcloud
https://github.com/nextcloud/nextcloud-vue
but no step by step guide on how to setup the Vue project after creating the skeleton app. I just saw that the Nextcloud app Tasks is also using Vue.js within the PHP code:
https://github.com/nextcloud/tasks
Thanks a lot for help.
I've looked at the repository you mentioned and it's fairly easy to setup, the question is what would you deserve after setup? If you clone the repository you have something like a 'working copy' of the plugin. But this Plugin needs to be build and the resulting package needs to be copied to right location at the nextcloud server (or maybe you have to install the package over frontend). This is some type of plugin and not a full web application which could run standalone, as I understood.
It's not like you said:
Nextcloud app Tasks is also using Vue.js within the PHP code
It's more like PHP is used for Backend and Vue is used for Frontend, these two 'projects' are completely independent from each other (PHP is backend and Vue is frontend there are no direct dependencies). Just create your Vue application (after build you will have an index.html and several js and css files) these files have to be available from browser. Then your applications entrypoint is the index.html. For PHP: You will just define Interfaces and Routes here which will give you the possibility to interact with the serverside. Then later to deploy your plugin, you have to package it in the format nextcloud needs. You can read from Makefile in the Tasks repository what happens if package is created.
I think a good starting point for you would be: https://docs.nextcloud.com/server/15/developer_manual/app/tutorial.html
I'm a bit confused about where something like this belongs to Laravel.
I want to write a web service client wrapper in laravel, and I want to access it like this:
\MyWSClient::getSomeInfoAbout($someId);
then the code will connect to the web service to http://www.someapi.com/api/getSomeInfoAbout?id=$someid&type=json with OAuth2 or some token requests, then fetch the data, keep token information until it expires, refresh token if needed etc.
But where will I put the code? In the vendor directory as a new package? I'm moving this code from a computer to another computer except vendor,storage and node_modules folders, because they are huge and when I do this, I will have to move only one folder in the vendor directory. And I'll need to publish a package under development to composer if I want portability etc.
Is there any other way to do something like this?
I think I've found the answer.
First I needed to use jeroen-g/laravel-packager package to create a new package using artisan console. I could've done that by hand, but I didn't know the required files.
Second, I've created a new package in the packages folder with my desired class name.
Third, I've added the provider and the alias for the class in app.php.
After that, I've created a test method in my controller and wrote a route for that. I called the static method I've written in the SkeletonClass the packager created for me.
And it worked with some tweaking after creation.
I've used php artisan packager:new tpaksu mypackage --i command for an interactive package creation which is cool.
Note: I've just learned the existence of this package, I'm not advertising it :)
I am sorry for this such question as I am still a fresh beginner in Phonegap.
I have followed some tutorial both for the installation and the jquery.mobile usage.
There are some parts (the biggest part) that I am confused with this Phonegap. And it is about the directory structure.
I am working with Private PHP Framework from my department, that is why I used Lamp Stack for all of this.
However, with the Phonegap tutorials I have been following this far, it looks like it have a little bit different environment structure from usual. It have five default directory as follows:
Hook
platforms
Plugins
www
In where the working directory for this Phonegap must be in the www directory.
It makes me afraid because our Apache Environment require us to put the directory in costume folder (Not in var/www), and then also the PHP Framework require us to put the module in a specific folder.
Please, I just need an enlightment for this Phonegap, how do you access the files and where do you guys put it.
Many thanks in advance.
As requested:
Create another vhost that points to www. You don't need to worry about hook, platform and plugins which are cordova/phonegap folders. Let them all at the same level (don't change the structure, just point the vhost to www).
The structure of cordova/phonegap is simple. Inside the www folder will be all your programming logic to build yours mobile app.
But beware, the cordova/phonegap does not compile code in PHP, it just uses a webview (like a browser) to run your mobile application developed with HTML, CSS and Javascript, packaged in a apk with access to native features of the smartphone/tablet, basically.
To make your application to communicate to the server in php you have two alternatives:
1) Making your app to access a URL that points to the application
developed with PHP and render its application in webview.
2) Create all purely on HTML, CSS and Javascript and make
communication via ajax, or socket or something similar to the server.
I want to start using Restler to develop a Rest api but, I couldn't find any detail information on how to install it, besides, it seems to run on a nginx server.
Is there a way to run this framework on apache? Are there other alternatives for building high quality APIS? Is there a detail documentation about installing this framework?
I must be able to run this framework on apache and using php5.3
Thanks
you have to enable apache mod_rewrite
I'm running restler (somewhat modified) for an API (api.hostingxs.nl). It works fine on apache with PHP 5.3. Just clone the repository from github (git clone https://github.com/Luracast/Restler.git <yourdirectory>) and start including classes that use it (read the manual).
If you need more directions I can post some sample code, but the basic functionality is really easy if you understand Object Oriented PHP.
First off, redirect all requests to your restler domain, folder to the index.php and create that file with something like this:
require_once( "restler.php" ); # or whatever you need to link to
$r = new Restler;
$r -> handle();
# above is the basic functionality without any of your own things
Click on the classes in the following link to read more about setting up your own classes; help.luracast.com/restler/examples/_002_minimal/readme.html
If you're wanting to create a RESTful API, then I created a lightweight framework for exactly that: https://github.com/martinbean/api-framework
In drupal, it's possible to create a "build", also known as "install profile" or "distribution" that basically combines several modules and your settings for them. So the next time you setup the same exact site, you don't have to re-configure all the modules.
Does Joomla have a similar concept, and what is it called? Please reference documentation as well if possible.
The concept is very simple - you just need to get a clean installation, install all the extensions you want and configure them the way you need.
Then it is enough to copy the files and the database to a new location and change the settings in the configuration file (configuration.php). That is all.
It is a very simple process and can easily be automated with a simple php script. I once did an asp.net app which was deploying new installations of joomla within seconds.
You could try something like http://www.akeebabackup.com/
This allows you to take a snapshot of a site and export it anywhere.