This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#0 /var/ftridp/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(640): Zend\ServiceManager\AbstractPluginManager->createFromInvokable('logincontroller...', 'Login\\Controlle...') | |
#1 /var/ftridp/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(597): Zend\ServiceManager\ServiceManager->doCreate('Login\\Controlle...', 'logincontroller...') | |
#2 /var/ftridp/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(530): Zend\ServiceManager\ServiceManager->create(Array) | |
#3 /var/ftridp/vendor/zendframework/zend-servicemanager/src/AbstractPluginManager.php(161): Zend\ServiceManager\ServiceManager->get('Login\\Controlle...', true) | |
#4 /var/ftridp/vendor/zendframework/zend-mvc/src/DispatchListener.php(94): Zend\ServiceManager\AbstractPluginManager->get('Login\\Controlle...') | |
#5 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent)) | |
#6 /var/ftridp/vendor/zendframework/zend-eventmanager/src/EventManager.php(490): call_user_func(Array, Object(Zend\Mvc\MvcEven |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#List unique values in a DataFrame column | |
pd.unique(df.column_name.ravel()) | |
#Convert Series datatype to numeric, getting rid of any non-numeric values | |
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True) | |
#Grab DataFrame rows where column has certain values | |
valuelist = ['value1', 'value2', 'value3'] | |
df = df[df.column.isin(value_list)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Codeception Test Suite Configuration | |
# suite for acceptance tests. | |
# perform tests in browser using the Selenium-like tools. | |
# powered by Mink (http://mink.behat.org). | |
# (tip: that's what your customer will see). | |
# (tip: test your ajax and javascript by one of Mink drivers). | |
# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace OappAccessControl; | |
use Zend\ServiceManager\FactoryInterface; | |
use Zend\ServiceManager\ServiceLocatorInterface; | |
use Zend\ServiceManager\ServiceLocatorAwareInterface; | |
use Zend\Permissions\Acl\Acl as AccessControlList; | |
use Zend\Permissions\Acl\Role\GenericRole as Role; | |
use Zend\Permissions\Acl\Resource\GenericResource as Resource; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This makes our life easier when dealing with paths. Everything is relative | |
* to the application root now. | |
*/ | |
chdir(dirname(__DIR__)); | |
// Decline static file requests back to the PHP built-in webserver | |
if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) { | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** Modules are in this file should only be activated in development env */ | |
return array( | |
'modules' => array('ZfTools', | |
'ZF\Apigility\Admin' | |
), | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class yourclass implements ServiceLocatorAwareInterface | |
{ | |
protected $serviceLocator; | |
public function setServiceLocator(ServiceLocatorInterface $serviceLocator) | |
{ | |
$this->serviceLocator = $serviceLocator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$account = $this->entityManager->getRepository('\Entity\Tables\tAccounts'); | |
/** Find the account from tAccounts table */ | |
$record = $account->findOneBy(array('userEmail' => $email)); | |
if ($record) { // There is an active account for given email. | |
/** Generate a unique token */ | |
$token = uniqid().uniqid(); | |
/** create a new tAccountPasswordReset object and fill the info */ | |
$newReset = new \Entity\Tables\tAccountPasswordReset(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** Create an object of tAccounts */ | |
$account = $this->entityManager->getRepository('\Entity\Tables\tAccounts'); | |
/** Find a record */ | |
$record = $account->findOneBy(array('userEmail' => $email)); | |
if ($record) { | |
/** get all the records in the tAccountPasswordReset table that link via foreign key (accountId) */ | |
$resetRecords = $record->getPasswordResets(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Entity\Tables; | |
use Zend\InputFilter\InputFilterAwareInterface; | |
use Zend\InputFilter\InputFilterInterface; | |
use Doctrine\ORM\Mapping as ORM; | |
use Doctrine\Common\Collections\ArrayCollection; | |
/** | |
* @ORM\Entity | |
*/ | |
class tAccountPasswordReset { |