Jump to content

Michael

Administrators
  • Content count

    2,372
  • Joined

  • Last visited

  • Days Won

    3

Michael last won the day on May 30

Michael had the most liked content!

Community Reputation

202 Excellent

2 Followers

About Michael

  • Rank
    Head Developer

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

12,270 profile views
  1. I had cobbled together a guide awhile back on how to do this, a bit has changed and some of the guide was inaccurate or had unneeded steps. Requirements: you will need to be up to date with windows 10, older versions of windows 10 does not have WSL. Make sure you windows is fully up to date, and you are comfortable with working with the command line or wish to learn more about the command line. other than that, enjoy the guide! So what is WSL? Well, basically it's the userspace from a linux distro added to win10 to allow you to run native linux apps (currently only CLI, some have gotten GUI stuff to work, but that is beyond the scope of this guide). Who is it for? Anyone really. I am a web developer, and one of the reasons i used linux for over 10 years as my daily driver, was due to how poorly a wamp stack performs compared to a lamp stack, and the differences you will encounter in how the two platforms operate. example: windows is a case insensitive OS, so windows doesn't see a difference between MyClass.php and myclass.php, this could be a problem with a case unaware autloloader on linux or mac os x. so it could lead to a unnecessary refactor if/when you deployed to linux/mac os x. I like this alternative mainly cause I migrated to a UHD monitor and use lower resolution monitors in the setup as well and linux has extremely poor fractional scaling (with the exception of KDE), windows scaling isn't perfect, but it is a lot better than any of the linux DE's atm. there were also other issues i ran into as well, as i recently also built a AMD Ryzen system, and ryzen's performance in linux isn't stellar, so least to say, Linux has several issues right now, that make it difficult for me to use well. So why should I use this over wamp or a linux setup? Don't get me wrong, apps likes WAMP/XAMP/MAMP are fine applications and if you are happy with those, then you shouldn't rock the boat. I do a lot of work outside of php with languages like python and technologies like node.js that don't perform very well in windows, they are actually quite cumbersome to install and to use in windows. So if you do more than just write wordpress plugins i suppose, then you'd prolly don't need this, but if you are curious how much greener the grass is, continue to read. so why should you use WSL over a full lamp stack? well the simple answers for me would be convenience. like the aforementioned issues i had running linux now days, this is sorta a meld of "best of both worlds". The Guide: Okay enough backstory, lets get started. First thing you will need to do is enable the sub system, you can do this a few ways. the fastest way imho is to start up a powershell in administrator mode (click start, type in powershell, when it comes up in cortana, right click on it and choose to run as administrator. if you have UAC enabled, it might prompt you if you wish to continue): Once it open enter this: (note: you can copy it, either right click on the powershell window or ctrl+v to paste it) Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux Press enter, it will do a few things, and then it will prompt you to restart. to continue you need to restart (did you really expect anything else? it is windows after all ) Now the Fun! Now once you are back after the reboot, you should be ready to install a distro. Now microsoft made this really simple, they put them in the app store. so open up the app store and search for 'linux': Click on "Get the apps" (if you don't see this, if you scroll down, under APPS, you will see the distro list). you should see this: There are a few distro's to choose from here. This guide will use Ubuntu, but in reality there really isn't any other choice IMHO. (i get this one a lot, "mike, how are you a ubuntu user? its for noobs and you know so much about linux!?", boggles the mind doesn't it? not really, Ubuntu is still more or less debian under the hood, it just has more recent packages and i think put together a bit better than debian and the other distro's, but any way, please refrain from ubuntu hate) any way, click on ubuntu: Now decision time, this guide will proceed almost identically regardless of your choice here. you can click install here and it will install ubuntu 16.04 LTS, however if you look below, you should see "people also like" and one of the options there, should be ubuntu 18.04 LTS. I highly recommend ubuntu 18.04 LTS as it is newer, and will be supported longer than 16.04 LTS, but the choice is yours. Let it install, once it is install click open. you will be greeted by a bash prompt, it will ask you for a username and a password (It should be noted as this has driven linux noobs insane, when you type in your password on the CLI, it will never indicate anything is being typed, so if you are expecting something like ****** to show up, it wont. ). Once you are done with that you will see a prompt like this: well it wont look exactly like this, but you can make it look like this here alright we have Ubuntu installed, first thing we are going to do is add this ppa (which will have the several versions of php available and updates for them when they come out), enter this into your bash prompt: sudo add-apt-repository ppa:ondrej/php this will add the ppa, next we are going to add the webmin Repo for ubuntu, next enter this command: sudo nano /etc/apt/sources.list this will open the nano editor, using your arrow keys, go all the way to the bottom and add this on a new line (you can copy from here and use right click to 'paste') deb http://download.webmin.com/download/repository sarge contrib to save, ctrl+o (saves) and then ctrl+x (exits), next enter these commands: wget http://www.webmin.com/jcameron-key.asc and then: sudo apt-key add jcameron-key.asc and finally: sudo apt update (this last command will update the package managers database). Alright if you have made it this far, you have completed all the EASY stuff (yes, you have permission to roll your eyes). now the stuff that follows, we will be installing and configure Ubuntu with a LAMP stack, plus with webmin. alright, lets install everything we will need: sudo apt install apache2 mysql-server php7.2 php7.2-xml php7.2-zip php7.2-mbstring php7.2-curl php7.2-mysql php7.2-gd php7.2-imagick curl webmin this can take awhile, webmin takes awhile to install, so go watch a show or play solitaire . once it is done, it will return the prompt. so everything is installed, so next we need to start everything, in bash, enter this: sudo service apache2 start && sudo service mysql start && sudo service webmin start (it will prompt you for your user password). it should start up all the services, you can check in your browser by going to http://localhost and you should see something like this: now check if webmin is running, it will be the computers name (the part in bash prompt after your username) on port 10000, so it would be something like this: https://desktop-jlddkqm:10000 or https://localhost:100000 (don't log into it just yet, just make sure it is running, you should see a login prompt). you will be told the site is unsafe cause it doesn't have a cert, you can make an exception or edit webmin's config to change this: sudo nano /etc/webmin/miniserv.conf find: ssl=1 and change it to: ssl=0 now save and exit (ctrl+o then ctrl+x). restart webmin: sudo service webmin restart (sometimes this doesn't work, and you need restart your computer, i am not sure why it does this, if you restart, don't forget to start up all the services again when you open up bash). if you installed ubuntu 18.04 or installed mysql-server 5.7+, you will need to do this: In mysql 5.7, you are no longer able to use root to access your database, so you will need to setup another user to do this, in bash: sudo mysql -u root -p it will prompt you for the mysql root password, which at this point should be empty, so just hit enter, if that fails, enter your user password. this will enter the mysql prompt, do the follow, making changes where it says username and MYPASSWORDGOESHERE: GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'MYPASSWORDGOESHERE'; hit enter, next: FLUSH PRIVILEGES; hit enter, and finally: quit hit enter, it will return you to the prompt. optional (you can instead choose to create a vhost to where you want your document root to be): next we will link a folder from our C drive in windows to a /var/www/html in ubuntu (as you can't edit files on the linux fs with windows editors, something about permissions). now in WSL any of your drives are auto-mounted in /mnt, your C:\ drive will be /mnt/c and any other drive will be mounted under their drive letter. we will be assuming your document root for your web app is C:\myapp, so we need to get this linked to your servers document root folder, which is /var/www/html. to do this, we will create a symlink: sudo ln -s /mnt/c/myapp /var/www/html this will now be accessible via http://localhost/myapp/ okay, that it is it. apache is running, webmin is running, and everything is installed to get your local dev environment running. this isn't the end of the guide, just if you want, you can stop here and go about configuring the rest on your own. however if you want to do some more things, keep reading. Extra: Start With Bash: I like adding stuff to my .bashrc, so when i start the bash prompt, everything starts up for me (after enter my password, but you can set it up where sudo doesn't require a password, but use at your own peril). in the bash prompt: nano .bashrc using the arrow keys, go to the end and start a new line. add the following, each on their own line: sudo service apache2 start sudo service mysql start sudo service cron start sudo service webmin start save and exit (ctrl+o and then ctrl+x) i like adding cron here, as there are times i need to test out task, and setting a cron is a lot easier than trying to figure out the voodoo magic that is windows scheduler. but when you first open up bash, you will be prompted for your password, and then the services will start. Module userdir: I really like this module, allows me to work from my home directory, from a folder called public_html and accessible from http://localhost/~username/. first thing to do is enable the module for apache: sudo a2enmod userdir now we need to tell php it can parse php in the home dir: sudo nano /etc/apache2/mods-available/php7.2.conf find: php_admin_flag engine off comment it out, so make it look like this: #php_admin_flag engine off save and exit (ctrl+o then ctrl+x). restart apache: sudo service apache2 restart create the public_html folder in your home directory: cd ~ takes you back to your home dir. mkdir public_html creates a folder called public_html in your home dir. ln -s /mnt/c/webapp ~/public_html will link your webapp folder from your C:\ drive to ~/public_html/webapp. you will be able to access it via url: http://localhost/~username/webapp. as you can see, there is potentially a lot of work that goes into setting up WSL for a LAMP stack. you might think it isn't worth it, and it might not be for some, but for others it will be, as it will open up more possibilities, with the technology and applications working in a native environment. btw...why did you have us install webmin, you didn't do anything with it! you are right, i didn't use it in this guide. you can log into it now, and you can configure your webserver from there. i wanted to show you how it is done on the CLI, to get an appreciation for the software, but with webmin, it will allow you to do configuration with a GUI for apache and php. so if you don't see any need for webmin and are comfortable with the command line editors, then you can uninstall it or not install it to begin with. if you have any questions or comments, let me know below!
  2. Michael

    Strange New User Group Issue

    Changed Status from Pending to Work in Progress
  3. Michael

    Support for Automation Rules

    Whoops\Exception\ErrorException thrown with message "Declaration of IPS\rules_hook_ipsOutput::sendOutput($output = '', $httpStatusCode = 200, $contentType = 'text/html', $httpHeaders = Array, $cacheThisPage = true, $pageIsCached = false, $parseFileObjects = true) should be compatible with IPS\_Output::sendOutput($output = '', $httpStatusCode = 200, $contentType = 'text/html', $httpHeaders = Array, $cacheThisPage = true, $pageIsCached = false, $parseFileObjects = true, $parseEmoji = true)" Stacktrace: #10 Whoops\Exception\ErrorException in /mnt/d/public_html/dev/hook_temp/IPS_OutputOutputapplications_rules_hooks_ipsOutput.php_1534985251.php:0 #9 Whoops\Run:handleError in /mnt/d/public_html/dev/init.php:470 #8 require_once in /mnt/d/public_html/dev/init.php:470 #7 IPS\IPS:monkeyPatch in /mnt/d/public_html/dev/init.php:437 #6 IPS\IPS:autoloader in [internal]:0 #5 spl_autoload_call in /mnt/d/public_html/dev/system/Dispatcher/Standard.php:54 #4 IPS\Dispatcher\_Standard:baseCss in /mnt/d/public_html/dev/hook_temp/IPS_Dispatcher_StandardStandardapplications_cjmg_hooks_DIspatcherStandard.php_1533876178.php:28 #3 IPS\Dispatcher\cjmg_hook_DIspatcherStandard:baseCss in /mnt/d/public_html/dev/system/Dispatcher/Front.php:650 #2 IPS\Dispatcher\_Front:baseCss in /mnt/d/public_html/dev/system/Dispatcher/Front.php:72 #1 IPS\Dispatcher\_Front:init in /mnt/d/public_html/dev/system/Dispatcher/Dispatcher.php:103 #0 IPS\_Dispatcher:i in /mnt/d/public_html/dev/index.php:13 this is one of the reasons i don't recommend rules, it's hooks throw errors. one of my clients had reported this one awhile back, i can see the latest version still hasn't fixed it. it also tends to make things that are optional in nodes/items, a requirement or the app will throw an error, again all have been reported, still not fixed. so take that at what you will. yes i do see the request for new features for this app, however i'd like to keep the app as simple as possible, not to give the false impression that it is a simple tool to detect potential duplicate accounts. if you can get the dev to rules to fix the errors i've mentioned, i would be more open to add support for it, but if i can't even get it installed on my dev board without it causing issues, i'm inclined to pass on it.
  4. Michael

    Support for Automation Rules

    i'll look into it, can't make any promises as a lot of my customers have had issues with rules, so there hasn't been a whole lot of demand in integration with it.
  5. Michael

    No new logs coming. Limitation?

    there aren't any limitation like that on the app. it might be a limitation put on it by your host or something, but i'll double check it. i was never able to reproduce this, but i'll try again.
  6. Michael

    The EU server is down

    it seems fine, i'm not showing any downtime for it in the logs. is it still happening to you?
  7. Michael

    Suggestion: Add ban reason

    Changed Status from Pending to Work in Progress
  8. Michael

    Suggestion: Add ban reason

    so you want like a members not added to the users account?
  9. Michael

    The Dev Toolbox

    Version 1.0.0

    0 downloads

    Note: Version 1.1.0+ of Dev Toolbox will require PHP 7.0 (minimum) to operate, as several of the libraries it uses were written for 7.0 and this has prompted us to update the app with php 7.0 features as well. This version was also designed with IPS 4.3 in mind, so it might not fully work in IPS 4.2.8 and below. The Dev Toolbox is a group of applications, designed with making working with IPS easier, and to reduce overall production time. There are a total of 6 apps (well a total of 7, but the 7th one is required to be installed with any of the others, as it contains data and code the rest of the apps use to function). These applications are being provided free of charge to the IPS developer community, but I ask if you find them useful or lifesaving, consider making a donation of any amount, to help ensure the future development of these fantastic tools. https://paypal.me/codingjungle if you would like to access the git repo: https://bitbucket.org/CodingJungle/devtools there will be two branches, master and develop. master will be what is found here in the download and develop will be any fixes, features, etc, that are in the works, so it might not be ready for general use. if you want access to be able to push, send me a PM with your bitbucket name/email and i will consider adding you. Here is a list of the apps and what they do (how they can benefit you). DT Proxy: This application will be most useful for those who use IDE's, especially if you use PHPStorm with the PHP-Toolbox plugin. Once you run it, it will create proxy class for IPS classes (most IDE's are unable to correlate an IPS class, to a class used in the code, due to the use of the _ in the class name). it will also attempt to create property tags for Database columns and the setters and getters found in your code. This is useful for autocomplete and code inspection in your IDE (will make it possible for the IDE to map the class's and their method usage). Php-Toolbox Improvements: PHP-Toolbox is a plugin for phpstorm, that makes it possible to add autocompletes for methods, and alter the return type as well. Template Return Type: on Theme::getTemplate($group), this will trigger a return type that matches the $group param of the method. this will then provide possible templates that the group can provide. this is limited due to only $group being required, so it might not return the "right" template (as groups and template names aren't regulated like class names are). In my testing and use, this feature is about 95% accurate most of the time. It drastically goes up, the more unique the template name is compared to others. say you have a group called "forms" with a template in it called 'text.phtml', since IPS also has this, it could potentially return the wrong one (depends really on which order the template was processed in). Application Hinting: there are several methods in IPS that require an "app" name in their parameter, this builds a list of app names from the apps installed to "show up" when those methods are called. Table name Hinting: this is for any method that calls a Database table name, dt proxy will generate a list of table names based on the tables present at execution time. Language String Hinting: will provide a list of available language strings that can be used. Template Group Hinting: provides a list of available template groups to most methods that use them as a param. ModPermission Hinting: provides a list of available modpermissions to the methods that use them as a param. Url Hinting: provides a list of available Query Strings that can be used. Furl Hinting: provides a list of available FURL definitions. PHP Core Hinting: adds in additional hinting's and return types for PHP methods. DT Proxy Extension: The dtproxy extension, you can add property types for Request and Data\Store. It already includes some of the most common property's found in both, but you can add to this with the extension in your applications. DT Dev Center Plus: This application extends the features of the developer center for applications in IPS. this will add 3 new tabs to the dev center, along with other improvments. Tabs: Sources: this allows you to create "sources" classes for your application. there are several predefined class types you can choose from. There are also options to handle some of the "mundane" things that are involved in creating several classes. most notably are the AR\Node\Items\Comments\Review classes. with each you have the option of creating the databases at creation with a basic layout (mainly the ID column) and with the prefix used if defined (for nodes/items/comments/review, this will also add too the class and to the table it creates, any required/optional fields for IPS traits or interfaces used). For nodes and items, it will also create the corresponding module and controller. (this feature can be turned off by turning of "create scaffolding"). Dev Folder: this tab allows you to create "Dev Folder" components, such as Templates and the JS skeletons. it is not as complex as Sources, but it saves time from hunting down and cloning an existing JS/template and removing the bits you don't need. Languages: This tab shows you all the defined language strings for your app, in both jslang and lang.php. this allows you to add/remove/alter while on the tab. Features: Extension Generator: instead of just generating a blank skeleton for extensions, this feature aims to provide a working out of the box extensions. this feature atm only supports FileStorage, ContentRouter and CreateMenu. Adding/Removing Column in Versioning: this feature will allow to easily add in a query to add/remove columns for versions. Extension: Dev Center Plus has an extension called "Headerdoc". it is a bit misleading name, but it gives you the ability to do several useful things when building an app. Enabled() (bool) : if this is set to true, it will add the classes "doc block" to the file if it doesn't already exist, and if it does, it will only alter it for the files include in the tar (so the file wont be marked as changed by your repo software if you use it). IndexEnabled() (bool): if this is set to true, it will add a blank index.html to all the folders and subfolders in your application. to prevent viewing of the directory contents on servers that do not have the directory listing turned off. fileSkip() (array): allows you to add a list of files to skip during the build process of the tar. there is also a "global" skip list in the settings of DT Base for this. dirSkip(array): allow you to skip entire folds during the build process of the tar. there is also a "global" dir skip list in the settings of DT Base. exclude() (array) : allows you add a file or folder here to skip having a "header doc" added to it. useful if you use third party libraries. will automatically exclude the following directories and files: 'hooks', 'dev', 'data', '3rdparty', '3rd_party', 'vendor', '.git' and '.idea'. DT Dev Folder: ever misplaced thos pesky dev folders for your app or don't feel like alter table entries to rebuild your "plugin" dev folder manually, or simply doing work for a client and having a conflict with another app/plugin but can't debug it in in_dev due to missing dev folders, well look no further Dev Folder is the app for you. this will generate dev folders for both apps and plugins (will also allow you to install plugins while in_dev is enabled). if you have the app installed and enabled, it will automagically add the dev folders if they don't already exists . DT Code: I'm not sure where i will be going with this application exactly, right now it will search thru your code looking for lang keys and settings, it will check and verify they are both in use and defined. it can return false positives as these might not always be "defined" in a way it can read it, but can give you the ability to see which language strings are in use and get rid of the "dead" ones and same with settings. if you have any suggestions for things you would want to check in your code, let me know and i will see about implementing this feature. DT Content: Creates "dummy" content for testing purposes. Generators: members - generates random members. can select to add members randomly to a random group. forums - generates forums. topics - generates topics. will create between 1 to 30 replies per topic created. posts - randomly adds replies to topic. clubs - creates clubs with random owners and various "types" *note: unlike the "storm" version, when forums are generated they will not create topics (there was a bit of problems with this in storm, so you should create forums first, then create the topics). DT Profiler: Replaces the IPS "query log" with a more compreshensive "profiler'. to enable you must have the define('QUERY_LOG', true) in your constants.php (if you want the cache log as well, you will need to have define('CACHING_LOG', true); as well). Tabs: Execution: will display the total time a page took to process from start to finish (this isn't the load time, so don't confuse the two :)). if you click on this tab, it will display how long the framework took and the profiler to execute, so you can rule out the profiler for slowdowns). memory used: The memory used by the page when it was being executed. This feature can be expanded upon by using the Memory class in Profiler. Included Files: shows how many files are included on the page, and if you click on it will show the a list of these files.* Query Log: displays the queries being executed for the page, along with their execution time and memory load. Caching Log: displayes the stores and caches being set or got during execution. Templates: a list of all the templates in use. * CSS: a list of all the CSS files loaded.* JS: a list of all the JS files loaded.* JSVars: a list of the JS Vars defined for use. Logs: shows the most recent logs that were generated (the amount it shows can be changed in the DT Base settings). Debug: if you use the Debug class, you can add debug statements inside your app's methods. this feature uses a long polling script to query the DB for new log entries and adds them here if they are found (useful for debuging Ajax request). if you use DT Dev Center Plus, you can add a permanent Profiler/Debug class to your app, this way you can add the \IPS\myapp\Profiler\Debug::add('key', 'message') to your methods and leave them there safely for future use (as the Profiler\Debug added by Dev Center Plus will create a class that uses __callStatic and checks to see if the parent class exists, other wise it will just be ignored) InfoBar: Gives basic information about the environment, IPS version, PHP version, and Contoller being executed, along with the Method and line number that method begins on.* *: if you have define('DEV_WHOOPS_EDITOR', 'phpstorm'); (or a supported editors) in your constants.php, it will generate a link that will open the file in editor if you have the phpstorm/supported editor protocol configured ( how to's for phpstorm (how to do this in windows) (how to in linux) (how to on mac not sure how well it works as i don't have a mac 😉 ) ); Slasher.php This is a command line application, that you can use to add backslashes to php internal functions and constants. This has been shown to improve performance on php 7+, due to opcode enhancements. this will also improved execution times as php doesn't have to look in the local space and then globalspace for defined functions. instructions in install.txt. DT Base: This app doesn't do much on its own. it mainly exist as a "core" app, to share usefule features and code among the rest of Dev Toolbox (so we aren't spending a great deal of time reinventing the wheel for common features). It also contains the Settings and DevBar menu. This app is REQUIRED to run any of the other apps, as they heavily depend on its libraries to function correctly. There are a ton of features and abilitis i'm probably forgetting to mention here, so why don't you try it yourself, it is free after all. Hope everyone enjoys this! send me any bugs or feedback to my PM's. i wont be supporting this application in my app topic. thanks to everyone who has made this app possible! License Note: The Dev Toolbox, where applicable, is released under the 2-Clause BSD License

    Free

  10. Michael

    Babble Version 3 Update

    don't have a firm date yet, finishing up the new features and interface, and about to enter a beta period for it before releasing. in the meantime, i've released a new version 2.7.4 for chat service, that uses a site cache for online counts (it updates every 15 minutes) it wont give a real time count, but it will show at least that some one has visited in the last 15 minutes. users who are in babble, will still get real time counts. hope this helps with the activity issue.
  11. Michael

    Babble v3 Alpha 6

    i broke the commands class, i have it fixed, but there were other things i wanted to get working before i went into "beta"
  12. Michael

    Babble v3 Alpha 6

    welp, i broke it lol
  13. Michael

    Babble v3 Alpha 6

    babble chat messages are run thru the text parser for IPS, which should already be doing the built in profanity filter, but i'll double check, maybe its an extra step (you never know with IPS any more :)) as in the unix timestamp? click on the gear icon, you will see there are already sound notification options (for new message, send messages and whispers). there is already an option in the settings to set the status. i don't really want to clutter up the UI with little buttons i can make it where if they are a friend in the profile, that it can do this, but it might not be in the initial release.
  14. Michael

    Babble Version 3 Alpha 5 and Responsive Height

    i've thought about grouping, i have commented out code for it, but it was a lot of buggy. i might revisit it after v3 releases.
  15. Michael

    Babble v3 Alpha 6

    lots of fine tuning has gone on this release private rooms and whispers should be working properly now. private rooms and whispers will now (or should) send out a notification if you are "offline" (each time you go to babble/switch a room/send a message, your last "online" time changes for babble, if that offline time is older than 15 minutes, you will be considered to be offline and a notification will be sent.). i've also made some style changes, dropped the background coloring, left them just to be all "white", you can still style them if you want, but i am going for a min. theme here.
×