1. Go to this page and download the library: Download pulli/pullbox library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pulli / pullbox example snippets
use Pulli\Pullbox\Dialog;
// Simple dialog with OK button
$result = Dialog::display('Are you sure?', 'Confirmation');
// Dialog with custom buttons, default and cancel
$result = Dialog::display('Save changes?', 'Save', [
'buttons' => ['Save', 'Discard', 'Cancel'],
'defaultButton' => 'Save',
'cancelButton' => 'Cancel',
]);
// Buttons referenced by position (1-indexed)
$result = Dialog::display('Continue?', 'Confirm', [
'buttons' => ['Yes', 'No'],
'defaultButton' => 1,
'cancelButton' => 2,
]);
// Dialog with text input
$result = Dialog::display('Enter your name:', 'Input', [
'answer' => true,
]);
// Pre-filled text input
$result = Dialog::display('Rename:', 'Edit', [
'answer' => 'current name',
]);
// Password input (hidden)
$result = Dialog::display('Password:', 'Auth', [
'answer' => true,
'hiddenAnswer' => true,
]);
// With icon (stop, caution, or note)
$result = Dialog::display('Are you sure?', 'Warning', [
'icon' => 'caution',
]);
// Auto-dismiss after N seconds
$result = Dialog::display('Closing soon...', 'Notice', [
'givingUpAfter' => 10,
]);
use Pulli\Pullbox\Notification;
// Simple notification
Notification::display('Download complete');
// With title
Notification::display('Download complete', 'My App');
// With subtitle
Notification::display('Download complete', 'My App', 'All files processed');
// With sound
Notification::display('Download complete', 'My App', null, 'Glass');
// All parameters
Notification::display('Download complete', 'My App', 'All files processed', 'Frog');
use Pulli\Pullbox\System;
// Get the Applications folder path
$path = System::applicationsFolder(); // e.g. "/Applications/"
// Move an app to Applications (quits it first, then relaunches)
System::moveApp('MyApp', '/tmp/MyApp.app');
// Move without relaunching
System::moveApp('MyApp', '/tmp/MyApp.app', launch: false);
// Get app version number
$version = System::versionNumber('Safari');
$version = System::versionNumber('Safari', 'CFBundleShortVersionString');
// Suppress error dialogs
$version = System::versionNumber('Safari', displayExceptions: false);
use Pulli\Pullbox\Music;
use Pulli\Pullbox\Enums\SystemSound;
// Export a playlist
Music::exportPlaylist('My Playlist', '/path/to/export.xml');
Music::exportPlaylist('My Playlist', '/path/to/export.m3u', 'm3u');
// Play a system sound
Music::playSystemSound(SystemSound::Glass);
Music::playSystemSound(SystemSound::Ping);